Model/Source/AbstractSource.php
<?php
/**
* Copyright © EAdesign by Eco Active S.R.L.,All rights reserved.
* See LICENSE for license details.
*/
namespace Eadesigndev\Pdfgenerator\Model\Source;
use Magento\Framework\Data\OptionSourceInterface;
abstract class AbstractSource implements OptionSourceInterface
{
/**
* Statuses
*/
const IS_DEFAULT = 1;
/**
* Get options
*
* @return array
*/
public function toOptionArray()
{
$options[] = ['label' => '', 'value' => ''];
$availableOptions = $this->getAvailable();
foreach ($availableOptions as $key => $value) {
$options[] = [
'label' => $value,
'value' => $key,
];
}
return $options;
}
}