本文整理汇总了PHP中Mage_Wishlist_Model_Item::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Wishlist_Model_Item::setData方法的具体用法?PHP Mage_Wishlist_Model_Item::setData怎么用?PHP Mage_Wishlist_Model_Item::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Wishlist_Model_Item
的用法示例。
在下文中一共展示了Mage_Wishlist_Model_Item::setData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadByProductWishlist
public function loadByProductWishlist(Mage_Wishlist_Model_Item $item, $wishlistId, $productId, array $sharedStores)
{
$select = $this->_getReadAdapter()->select()->from(array('main_table' => $this->getTable('item')))->where('main_table.wishlist_id = ?', $wishlistId)->where('main_table.product_id = ?', $productId)->where('main_table.store_id in (?)', $sharedStores);
if ($_data = $this->_getReadAdapter()->fetchRow($select)) {
$item->setData($_data);
}
return $item;
}
示例2: loadByProductWishlist
/**
* Load item by wishlist, product and shared stores
*
* @param Mage_Wishlist_Model_Item $object
* @param int $wishlistId
* @param int $productId
* @param array $sharedStores
* @return Mage_Wishlist_Model_Mysql4_Item
*/
public function loadByProductWishlist($object, $wishlistId, $productId, $sharedStores)
{
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getMainTable())->where('wishlist_id=?', $wishlistId)->where('product_id=?', $productId)->where('store_id IN(?)', $sharedStores);
$data = $adapter->fetchRow($select);
if ($data) {
$object->setData($data);
}
$this->_afterLoad($object);
return $this;
}
示例3: loadByProductWishlist
/**
* Load item by wishlist, product and shared stores
*
* @param Mage_Wishlist_Model_Item $object
* @param int $wishlistId
* @param int $productId
* @param array $sharedStores
* @return Mage_Wishlist_Model_Resource_Item
*/
public function loadByProductWishlist($object, $wishlistId, $productId, $sharedStores)
{
$adapter = $this->_getReadAdapter();
$storeWhere = $adapter->quoteInto('store_id IN (?)', $sharedStores);
$select = $adapter->select()->from($this->getMainTable())->where('wishlist_id=:wishlist_id AND ' . 'product_id=:product_id AND ' . $storeWhere);
$bind = array('wishlist_id' => $wishlistId, 'product_id' => $productId);
$data = $adapter->fetchRow($select, $bind);
if ($data) {
$object->setData($data);
}
$this->_afterLoad($object);
return $this;
}