/** * Prepare posts collection * * @return void */ protected function _preparePostCollection() { parent::_preparePostCollection(); if ($tag = $this->getTag()) { $this->_postCollection->addTagFilter($tag); } }
/** * Prepare posts collection * * @return void */ protected function _preparePostCollection() { parent::_preparePostCollection(); if ($category = $this->getCategory()) { $this->_postCollection->addCategoryFilter($category); } }
/** * Prepare posts collection * * @return void */ protected function _preparePostCollection() { parent::_preparePostCollection(); if ($author = $this->getAuthor()) { $this->_postCollection->addAuthorFilter($author); } }
/** * Prepare posts collection * * @return void */ protected function _preparePostCollection() { parent::_preparePostCollection(); if ($category = $this->getCategory()) { $categories = $category->getChildrenIds(); $categories[] = $category->getId(); $this->_postCollection->addCategoryFilter($categories); } }
/** * Prepare posts collection * @return \Magefan\Blog\Model\ResourceModel\Post\Collection */ protected function _preparePostCollection() { parent::_preparePostCollection(); $this->_postCollection->getSelect()->where('MONTH(publish_time) = ?', $this->getMonth())->where('YEAR(publish_time) = ?', $this->getYear()); }
/** * Prepare posts collection * * @return void */ protected function _preparePostCollection() { parent::_preparePostCollection(); $q = $this->getQuery(); $this->_postCollection->addFieldToFilter(['title', 'content_heading', 'content'], [['like' => '%' . $q . '%'], ['like' => '%' . $q . '%'], ['like' => '% ' . $q . ' %']]); }
/** * Prepare posts collection * * @return void */ protected function _preparePostCollection() { parent::_preparePostCollection(); $q = $this->getRequest()->getParam('q'); $this->_postCollection->addFieldToFilter(array('title', 'content_heading', 'content'), array(array('like' => '%' . $q . '%'), array('like' => '%' . $q . '%'), array('like' => '% ' . $q . ' %'))); }