当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Abstract::getProductId方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Abstract::getProductId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::getProductId方法的具体用法?PHP Mage_Core_Model_Abstract::getProductId怎么用?PHP Mage_Core_Model_Abstract::getProductId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Abstract的用法示例。


在下文中一共展示了Mage_Core_Model_Abstract::getProductId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getAlertRow

 protected function _getAlertRow(Mage_Core_Model_Abstract $object)
 {
     if ($object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
         $sql = $this->_getWriteAdapter()->select()->from($this->getMainTable())->where('customer_id=?', $object->getCustomerId())->where('product_id=?', $object->getProductId())->where('website_id=?', $object->getWebsiteId());
         return $this->_getWriteAdapter()->fetchRow($sql);
     }
     return false;
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:8,代码来源:Stock.php

示例2: _getAlertRow

 /**
  * Retrieve alert row by object parameters
  *
  * @param Mage_Core_Model_Abstract $object
  * @return array|bool
  */
 protected function _getAlertRow(Mage_Core_Model_Abstract $object)
 {
     $adapter = $this->_getReadAdapter();
     if ($object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
         $select = $adapter->select()->from($this->getMainTable())->where('customer_id = :customer_id')->where('product_id  = :product_id')->where('website_id  = :website_id');
         $bind = array(':customer_id' => $object->getCustomerId(), ':product_id' => $object->getProductId(), ':website_id' => $object->getWebsiteId());
         return $adapter->fetchRow($select, $bind);
     }
     return false;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:16,代码来源:Abstract.php

示例3: _beforeSave

 /**
  * Before save action
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (is_null($object->getId()) && $object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) {
         if ($row = $this->_getAlertRow($object)) {
             $object->addData($row);
             $object->setStatus(0);
         }
     }
     if (is_null($object->getAddDate())) {
         $object->setAddDate(Mage::getModel('core/date')->gmtDate());
         $object->setStatus(0);
     }
     return parent::_beforeSave($object);
 }
开发者ID:okite11,项目名称:frames21,代码行数:20,代码来源:Stock.php

示例4: _afterSave

 /**
  * Assign page to store views
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Cms_Model_Resource_Page
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->hasProductId()) {
         $oldProducts = $this->getProductIds($object->getId());
         $newProducts = (array) $object->getProductId();
         $table = $this->getTable('cmsproducts/cms_page_product');
         $insert = array_diff($newProducts, $oldProducts);
         $delete = array_diff($oldProducts, $newProducts);
         if ($delete) {
             $where = array('page_id = ?' => (int) $object->getId(), 'product_id IN (?)' => $delete);
             $this->_getWriteAdapter()->delete($table, $where);
         }
         if ($insert) {
             $data = array();
             foreach ($insert as $productId) {
                 $data[] = array('page_id' => (int) $object->getId(), 'product_id' => (int) $productId);
             }
             $this->_getWriteAdapter()->insertMultiple($table, $data);
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:madgals,项目名称:Magento_CmsProducts,代码行数:28,代码来源:Page.php

示例5: getAllParentSkuFromItem

 /**
  * Get current and parent product SKU from the quote item.
  *
  * @param  Mage_Core_Model_Abstract
  * @return array
  */
 protected function getAllParentSkuFromItem(Mage_Core_Model_Abstract $item)
 {
     $skus = [$item->getSku()];
     /** @var Mage_Sales_Model_Quote_Item */
     $parentItem = $item->getParentItem();
     if ($parentItem) {
         if ($item->getProductId() !== $parentItem->getProductId()) {
             $skus[] = $parentItem->getSku();
         }
     }
     return $skus;
 }
开发者ID:ryaan-anthony,项目名称:magento-retail-order-management,代码行数:18,代码来源:Data.php


注:本文中的Mage_Core_Model_Abstract::getProductId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。