Untitled

mail@pastecode.io avatar
unknown
php
2 years ago
769 B
3
Indexable
Never
<?php

declare(strict_types=1);

namespace Creativestyle\CustomizationMegaportKaspersky\Model\Config\Source;

class LicenseTime extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    protected array $options;

    public function __construct(array $options = [])
    {
        $this->options = $options;
    }

    /**
     * @return array
     */
    public function getAllOptions()
    {
        $options = [];

        array_push($this->options, 'Select license type');
        $this->options = array_reverse($this->options);

        foreach ($this->options as $optionId => $option) {
            $options[] = [
                'label' => __($option),
                'value' => $optionId
            ];
        }

        return $options;
    }
}