Пример #1
0
 /**
  * filter by store
  *
  * @param Collection $collection
  * @param Column $column
  * @return $this
  */
 public function filterStoreCondition(Collection $collection, Column $column)
 {
     if (!($value = $column->getFilter()->getValue())) {
         return $this;
     }
     $collection->addStoreFilter($value);
     return $this;
 }
Пример #2
0
 /**
  * @return \Sample\News\Model\Resource\Author\Collection
  */
 public function getAuthorCollection()
 {
     if (is_null($this->authorCollection)) {
         $this->authorCollection = $this->categoryModel->getSelectedAuthorsCollection($this->getCategory())->addStoreFilter($this->_storeManager->getStore()->getId())->addFieldToFilter('is_active', 1);
         //TODO: use constant here
         $this->authorCollection->getSelect()->order('related_category.position');
     }
     return $this->authorCollection;
 }