<?php
namespace Autogedal\Banners\Model\Config\Product;

class Banners extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    public function getAllOptions()
    {


        if (!$this->_options) {
            $objectManager =   \Magento\Framework\App\ObjectManager::getInstance();
            $connection = $objectManager->get('Autogedal\Banners\Model\Banner')->getCollection();

            foreach ($connection as $item)
            {
                $this->_options[] = [
                    'value' => $item->getId(),
                    'label' => $item->getTitle(),
                ];
            }
        }

        return $this->_options;
    }
}
