/** * @return $this */ protected function _prepareCollection() { $collection = $this->_bannerFactory->create()->getCollection(); $this->setCollection($collection); parent::_prepareCollection(); return $this; }
public function getBannerImages() { $collection = $this->_bannerFactory->create()->getCollection(); $group = $this->getData('group'); $collection->addFieldToFilter('group', $group); $collection->addFieldToFilter('is_active', 1); return $collection; }
/** * 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; }