_bannerFactory = $bannerFactory; } /** * Options getter * * @return array */ public function toOptionArray() { $optionArray = array(); foreach($this->toArray() as $arr){ $optionArray[] = array( 'value' => $arr , 'label' => $arr); } return $optionArray; } /** * Get options in "key-value" format * * @return array */ public function toArray() { $group = array(); $collection = $this->_bannerFactory->create()->getCollection(); foreach($collection as $banner){ $group[$banner->getGroup()] = $banner->getGroup(); } return $group; } }