예제 #1
0
 /**
  * Save data for product relations
  *
  * @param   EM_Blog_Model_Post $post
  * @return  EM_Blog_Model_Post_Link
  */
 public function saveProductRelations($post)
 {
     $data = $post->getRelatedLinkData();
     if (!is_null($data)) {
         $this->_getResource()->saveProductLinks($post, $data, self::LINK_TYPE_RELATED);
     }
     return $this;
 }
예제 #2
0
 /**
  * Retrieve post tags identifiers
  *
  * @param EM_Blog_Model_Post $post
  * @return array
  */
 public function getTagIds($post)
 {
     $adapter = $this->_getReadAdapter();
     $select = $adapter->select()->from($this->_postTagTable, 'tag_id')->where('post_id = ?', (int) $post->getId());
     return $adapter->fetchCol($select);
 }
예제 #3
0
 /**
  * Initialize collection parent product and add limitation join
  *
  * @param Mage_Catalog_Model_Product $product
  * @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection
  */
 public function setProduct(EM_Blog_Model_Post $product)
 {
     $this->_post = $product;
     if ($product && $product->getId()) {
         $this->_hasLinkFilter = true;
     }
     return $this;
 }