Model/Config/Source/CategoryView.php
<?php
/**
* Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
*
* @copyright Copyright (c) 2017-2022 Tweakwise.com B.V. (https://www.tweakwise.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
namespace Tweakwise\Magento2Tweakwise\Model\Config\Source;
use Tweakwise\Magento2Tweakwise\Model\Catalog\Layer\Url\Strategy\PathSlugStrategy;
use Tweakwise\Magento2Tweakwise\Model\Catalog\Layer\Url\Strategy\QueryParameterStrategy;
use Magento\Framework\Data\OptionSourceInterface;
class CategoryView implements OptionSourceInterface
{
/**
* Possible filter types
*/
public const EXTENDED = 1;
public const SIMPLE = 0;
/**
* @var array[]
*/
protected $options;
/**
* @return array
*/
protected function buildOptions()
{
return [
['value' => self::SIMPLE, 'label' => __('Simple (deprecated)')],
['value' => self::EXTENDED, 'label' => __('Extended')],
];
}
/**
* {@inheritdoc}
*/
public function toOptionArray()
{
if (!$this->options) {
$this->options = $this->buildOptions();
}
return $this->options;
}
}