_objectManager = ObjectManager::getInstance(); } public function toOptionArray() { $options = []; if (!$this->group) { $this->group = $this->_objectManager->get('\Olegnax\BannerSlider\Model\ResourceModel\Group\CollectionFactory')->create(); } if ($this->group && $this->group->getSize()) { $groups = $this->group->addFieldToSelect('*')->setOrder('group_name', 'asc'); foreach ($groups as $group) { $options[] = [ 'value' => $group->getIdentifier(), 'label' => $group->getGroupName() ]; } } return $options; } }