<?php
/**
 * Webkul Software.
 * 
 * PHP version 7.0+
 *
 * @category  Webkul
 * @package   Webkul_MobikulCore
 * @author    Webkul <support@webkul.com>
 * @copyright 2010-2019 Webkul Software Private Limited (https://webkul.com)
 * @license   https://store.webkul.com/license.html ASL Licence
 * @link      https://store.webkul.com/license.html
 */

namespace Webkul\MobikulCore\Model\Notification\Source;

use Magento\Framework\Data\OptionSourceInterface;

class Type implements OptionSourceInterface
{

    protected $_mobikulNotification;

    public function __construct(\Webkul\MobikulCore\Model\Notification $mobikulNotification)
    {
        $this->_mobikulNotification = $mobikulNotification;
    }

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