Example #1
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     if (is_null($this->_postCollection)) {
         $this->_postCollection = parent::_getPostCollection()->addPostTypeFilter(array('post', 'page'))->addSearchStringFilter($this->getParsedSearchString(), array('post_title', 'post_content', 'post_excerpt'), 'OR');
     }
     return $this->_postCollection;
 }
Example #2
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     if (is_null($this->_postCollection)) {
         $this->_postCollection = parent::_getPostCollection()->addArchiveDateFilter($this->getArchiveId(), $this->getArchive()->getIsDaily());
     }
     return $this->_postCollection;
 }
 /**
  * Set the number of posts to display to 5
  * This can be overridden using self::setPostCount($postCount)
  */
 public function __construct()
 {
     parent::__construct();
     $this->_pagerLimit = 5;
     $this->setPostListTemplate('wordpress/post/associated/list.phtml');
     $this->setTitle('Blog Posts Associated With This Product');
 }
Example #4
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     if (is_null($this->_postCollection)) {
         $this->_postCollection = parent::_getPostCollection()->addCategoryIdFilter($this->getCurrentCategoryId());
     }
     return $this->_postCollection;
 }
Example #5
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     if (is_null($this->_postCollection)) {
         $this->_postCollection = parent::_getPostCollection()->addAuthorIdFilter($this->getAuthorId());
     }
     return $this->_postCollection;
 }
Example #6
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     if (is_null($this->_postCollection)) {
         $helper = Mage::helper('wordpress/search');
         $this->_postCollection = parent::_getPostCollection()->addPostTypeFilter(array('post', 'page'))->addSearchStringFilter($helper->getParsedSearchString(), $helper->getSearchableFields(), $helper->getLogicalOperator());
     }
     return $this->_postCollection;
 }
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     if (is_null($this->_postCollection)) {
         $this->_postCollection = parent::_getPostCollection()->addSearchStringFilter($this->_getParsedSearchString(), array('post_title', 'post_content'));
         if ($postTypes = $this->getRequest()->getParam('post_type')) {
             $this->_postCollection->addPostTypeFilter($postTypes);
         } else {
             $this->_postCollection->addPostTypeFilter(array('post', 'page'));
         }
     }
     return $this->_postCollection;
 }
Example #8
0
	/**
	 * Adds on cateogry/author ID filters
	 *
	 * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
	 */
	protected function _getPostCollection()
	{
		$collection = parent::_getPostCollection()
			->setPageSize($this->_pagerLimit)
			->setCurPage(1);

		if ($categoryId = $this->getData('category_id')) {
			$collection->addCategoryIdFilter($categoryId);
		}
		
		if ($authorId = $this->getData('author_id')) {
			$collection->addAuthorIdFilter($authorId);
		}

		return $collection;
	}
Example #9
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     return parent::_getPostCollection()->addArchiveDateFilter($this->getArchiveId(), $this->getArchive()->getIsDaily());
 }
Example #10
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     return parent::_getPostCollection()->addAuthorIdFilter($this->getAuthorId());
 }
Example #11
0
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     return parent::_getPostCollection()->addStickyPostsToCollection();
 }
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     return parent::_getPostCollection()->addStickyPostsToCollection()->addPostTypeFilter('post');
 }
 /**
  * Generates and returns the collection of posts
  *
  * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection
  */
 protected function _getPostCollection()
 {
     return parent::_getPostCollection()->addFieldToFilter('post_author', $this->getAuthor()->getId());
 }