Beispiel #1
0
 /**
  * Add summary data to specified object
  *
  * @deprecated after 1.4.0.0
  *
  * @param Mage_Tag_Model_Tag $object
  * @return Mage_Tag_Model_Tag
  */
 public function addSummary($object)
 {
     $read = $this->_getReadAdapter();
     $select = $read->select()->from(array('relation' => $this->getTable('tag/relation')), array())->joinLeft(array('summary' => $this->getTable('tag/summary')), 'relation.tag_id = summary.tag_id AND relation.store_id = summary.store_id', array('customers', 'products', 'popularity'))->where('relation.tag_id = :tag_id')->where('relation.store_id = :store_id')->limit(1);
     $bind = array('tag_id' => (int) $object->getId(), 'store_id' => (int) $object->getStoreId());
     $row = $read->fetchRow($select, $bind);
     if ($row) {
         $object->addData($row);
     }
     return $object;
 }
 /**
  * Add TAG to PRODUCT relations
  *
  * @param Mage_Tag_Model_Tag $model
  * @param array $productIds
  * @return Mage_Tag_Model_Tag_Relation
  */
 public function addRelations(Mage_Tag_Model_Tag $model, $productIds = array())
 {
     $this->setAddedProductIds($productIds);
     $this->setTagId($model->getTagId());
     $this->setCustomerId(null);
     $this->setStoreId($model->getStoreId());
     $this->_getResource()->addRelations($this);
     return $this;
 }
 /**
  * Add summary data
  *
  * @param Mage_Tag_Model_Tag $object
  * @return Mage_Tag_Model_Tag
  */
 public function addSummary($object)
 {
     $select = $this->_getReadAdapter()->select()->from($this->getTable('summary'))->where('tag_id = ?', (int) $object->getId())->where('store_id = ?', (int) $object->getStoreId())->limit(1);
     $row = $this->_getReadAdapter()->fetchRow($select);
     if ($row) {
         $object->addData($row);
     }
     return $object;
 }