<?php
    /**
    * Webkul Software.
    *
    * @category  Webkul
    * @package   Webkul_MobikulCore
    * @author    Webkul
    * @copyright Copyright (c) 2010-2019 Webkul Software Private Limited (https://webkul.com)
    * @license   https://store.webkul.com/license.html
    */

    namespace Webkul\MobikulCore\Model\Featuredcategories\Source;
    use Magento\Framework\Data\OptionSourceInterface;

    class Type implements OptionSourceInterface     {

        protected $_mobikulFeaturedcategories;

        public function __construct(\Webkul\MobikulCore\Model\Featuredcategories $mobikulFeaturedcategories) {
            $this->_mobikulFeaturedcategories = $mobikulFeaturedcategories;
        }

        public function toOptionArray()     {
            $availableOptions = $this->_mobikulFeaturedcategories->getAvailableTypes();
            $options = [];
            foreach ($availableOptions as $key => $value) {
                $options[] = [
                    "label" => $value,
                    "value" => $key
                ];
            }
            return $options;
        }

    }