<?php
/**
 * Copyright 2018-2019 © Intelligent IT SRL. All rights reserved.
 */


namespace Leadlion\StockUpdates\Model\Config;

use Magento\Framework\Message\ManagerInterface;
use SmartBill\Integration\Helper\Data;
use SmartBill\Integration\Helper\Settings;
use SmartBill\Integration\Model\Config\BaseConfig;

/**
 * Source model for InvoiceSeries
 */
class Manufacturers extends BaseConfig
{
    /**
     * @var Data
     */
    private $helper;

    /**
     * @var \Magento\Eav\Model\Config
     */
    private $eavConfig;
    
    public function __construct
    (
        Data $helper,
        \Magento\Eav\Model\Config $eavConfig
    )
    {
        $this->helper = $helper;
        $this->eavConfig = $eavConfig;
    }
    /**
     * Returns array to be used in options array
     *
     * @return array
     */
    public function toOptionArray()
    {

        $attribute = $this->eavConfig->getAttribute('catalog_product', 'manufacturer');
        $attributeOptions = $attribute->getSource()->getAllOptions();
        foreach ($attributeOptions as $key => $item) {
            $options[$key] = [
                'label' => $item['label'],
                'value' => $item['value'],
            ];
        }

        return $options;

    }

}

