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


PHP Mage_Core_Model_Abstract::setStoreId方法代码示例

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


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

示例1: _afterLoad

 /**
  * Perform operations after object load
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getId()) {
         $stores = $this->lookupStoreIds($object->getId());
         $object->setStoreId($stores);
     }
     return parent::_afterLoad($object);
 }
开发者ID:xiaoguizhidao,项目名称:easy-shipping-rules,代码行数:15,代码来源:Custommethod.php

示例2: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $object->setStoreId($this->getStoreId());
     if (!$this->isUniqueCategory($object)) {
         Mage::throwException(Mage::helper('downloads')->__("Category '%s' already exist", $object->getTitle()));
     }
     return parent::_beforeSave($object);
 }
开发者ID:commercekitchen,项目名称:dualeyewear-magento,代码行数:8,代码来源:Categories.php

示例3: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $date = new Zend_Date();
     if (!$object->getId()) {
         $object->setCreatedAt($date->toString(self::DATE_FORMAT));
         $object->setStoreId(Mage::app()->getStore()->getId());
     }
     parent::_beforeSave($object);
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:9,代码来源:List.php

示例4: _afterLoad

 /**
  * Load store data after loading model
  *
  * @param Mage_Core_Model_Abstract $object
  * @return $this
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getId()) {
         $storeIds = $this->lookupStoreIds($object->getId());
         $object->setData('store_ids', $storeIds);
         if (!$this->isAdmin()) {
             $object->setStoreId(Mage::app()->getStore(true)->getId());
         }
     }
     return parent::_afterLoad($object);
 }
开发者ID:Benjamin021,项目名称:magento-attribute-page,代码行数:17,代码来源:Abstract.php

示例5: _afterLoad

 /**
  * Function called after a model is loaded (but not when a collection of models are loaded)
  * If filters set, unserialize (convert to an array)
  *
  * @param Mage_Core_Model_Abstract $object
  * @return $this
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getId()) {
         $storeIds = $this->lookupStoreIds($object->getId());
         if ($this->isAdmin()) {
             $object->setData('store_id', $storeIds);
         } else {
             $object->setStoreId(Mage::app()->getStore(true)->getId());
             if (count($storeIds) === 1) {
                 if ($storeIds[0] != 0) {
                     $object->setStoreId((int) array_shift($storeIds));
                 }
             }
         }
     }
     if ($this->isAdmin()) {
         $this->_loadAdminData($object);
     }
     return parent::_afterLoad($object);
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:27,代码来源:Page.php

示例6: _afterLoad

 /**
  * Load store data after loading model
  *
  * @param Mage_Core_Model_Abstract $object
  * @return $this
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getId()) {
         $storeIds = $this->lookupStoreIds($object->getId());
         $object->setData('store_ids', $storeIds);
         if (!$this->isAdmin()) {
             $object->setStoreId(Mage::app()->getStore(true)->getId());
         }
         if ($object->getCustomFields()) {
             $customFields = @unserialize($object->getCustomFields());
             if (is_array($customFields)) {
                 foreach ($customFields as $field => $value) {
                     $object->setData($field, $value);
                 }
             }
         }
     }
     return parent::_afterLoad($object);
 }
开发者ID:sreichel,项目名称:magento-Fishpig-Attribute-Splash-Pages,代码行数:25,代码来源:Abstract.php


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