![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-search/Ui/Component/Listing/Column/Website/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Search\Ui\Component\Listing\Column\Website; use Magento\Framework\Escaper; use Magento\Framework\Data\OptionSourceInterface; use Magento\Store\Model\System\Store as SystemStore; class Options implements OptionSourceInterface { /** * All Store Views value */ const ALL_WEBSITES = '0'; /** * Escaper * * @var Escaper */ protected $escaper; /** * System store * * @var SystemStore */ protected $systemStore; /** * Constructor * * @param SystemStore $systemStore * @param Escaper $escaper */ public function __construct(SystemStore $systemStore, Escaper $escaper) { $this->systemStore = $systemStore; $this->escaper = $escaper; } /** * Get options * * @return array */ public function toOptionArray() { $currentOptions['']['label'] = '--'; $currentOptions['']['value'] = '--'; $currentOptions['All Store Views']['label'] = __('All Websites'); $currentOptions['All Store Views']['value'] = self::ALL_WEBSITES; $websiteCollection = $this->systemStore->getWebsiteCollection(); foreach ($websiteCollection as $website) { $name = $this->escaper->escapeHtml($website->getName()); $currentOptions[$name]['label'] = $name; $currentOptions[$name]['value'] = $website->getId(); } return $currentOptions; } }