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


PHP Mage_Core_Model_Abstract::getWebsiteIds方法代码示例

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


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

示例1: _afterSave

 /**
  * Bind gift rule to customer group(s) and website(s).
  * Save rule's associated store labels.
  * Save product attributes used in rule.
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Mage_SalesRule_Model_Resource_Rule
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->hasStoreLabels()) {
         $this->saveStoreLabels($object->getId(), $object->getStoreLabels());
     }
     if ($object->hasWebsiteIds()) {
         $websiteIds = $object->getWebsiteIds();
         if (!is_array($websiteIds)) {
             $websiteIds = explode(',', (string) $websiteIds);
         }
         $this->bindRuleToEntity($object->getId(), $websiteIds, 'website');
     }
     if ($object->hasCustomerGroupIds()) {
         $customerGroupIds = $object->getCustomerGroupIds();
         if (!is_array($customerGroupIds)) {
             $customerGroupIds = explode(',', (string) $customerGroupIds);
         }
         $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group');
     }
     if ($object->hasProductIds()) {
         $productIds = $object->getProductIds();
         if (!is_array($productIds)) {
             $productIds = explode(',', (string) $productIds);
         }
         $this->bindRuleToEntity($object->getId(), $productIds, 'product');
     }
     // Save product attributes used in rule
     $ruleProductAttributes = array_merge($this->getProductAttributes(serialize($object->getConditions()->asArray())), $this->getProductAttributes(serialize($object->getActions()->asArray())));
     if (count($ruleProductAttributes)) {
         $this->setActualProductAttributes($object, $ruleProductAttributes);
     }
     return parent::_afterSave($object);
 }
开发者ID:xiaoguizhidao,项目名称:ortodon,代码行数:42,代码来源:Rule.php

示例2: _afterSave

 /**
  * Bind reminder rule to and website(s).
  * Save store templates data.
  *
  * @param Mage_Core_Model_Abstract $rule
  * @return Enterprise_Reminder_Model_Resource_Rule
  */
 protected function _afterSave(Mage_Core_Model_Abstract $rule)
 {
     if ($rule->hasWebsiteIds()) {
         $websiteIds = $rule->getWebsiteIds();
         if (!is_array($websiteIds)) {
             $websiteIds = explode(',', (string) $websiteIds);
         }
         $this->bindRuleToEntity($rule->getId(), $websiteIds, 'website');
     }
     if ($rule->hasData('store_templates')) {
         $this->_saveStoreData($rule);
     }
     parent::_afterSave($rule);
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:22,代码来源:Rule.php

示例3: _afterSave

 /**
  * Bind catalog rule to customer group(s) and website(s).
  * Update products which are matched for rule.
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Mage_CatalogRule_Model_Resource_Rule
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->hasWebsiteIds()) {
         $websiteIds = $object->getWebsiteIds();
         if (!is_array($websiteIds)) {
             $websiteIds = explode(',', (string) $websiteIds);
         }
         $this->bindRuleToEntity($object->getId(), $websiteIds, 'website');
     }
     if ($object->hasCustomerGroupIds()) {
         $customerGroupIds = $object->getCustomerGroupIds();
         if (!is_array($customerGroupIds)) {
             $customerGroupIds = explode(',', (string) $customerGroupIds);
         }
         $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group');
     }
     parent::_afterSave($object);
     return $this;
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:27,代码来源:Rule.php

示例4: _afterSave

 /**
  * Bind sales rule to customer group(s) and website(s).
  * Save rule's associated store labels.
  * Save product attributes used in rule.
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Mage_SalesRule_Model_Resource_Rule
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->hasStoreLabels()) {
         $this->saveStoreLabels($object->getId(), $object->getStoreLabels());
     }
     if ($object->hasWebsiteIds()) {
         $websiteIds = $object->getWebsiteIds();
         if (!is_array($websiteIds)) {
             $websiteIds = explode(',', (string) $websiteIds);
         }
         $this->bindRuleToEntity($object->getId(), $websiteIds, 'website');
     }
     if ($object->hasCustomerGroupIds()) {
         $customerGroupIds = $object->getCustomerGroupIds();
         if (!is_array($customerGroupIds)) {
             $customerGroupIds = explode(',', (string) $customerGroupIds);
         }
         $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group');
     }
     // Save product attributes used in rule
     $ruleProductAttributes = array_merge($this->getProductAttributes(serialize($object->getConditions()->asArray())), $this->getProductAttributes(serialize($object->getActions()->asArray())));
     if (count($ruleProductAttributes)) {
         $this->setActualProductAttributes($object, $ruleProductAttributes);
     }
     // Update auto geterated specific coupons if exists
     if ($object->getUseAutoGeneration() && $object->hasDataChanges()) {
         Mage::getResourceModel('Mage_SalesRule_Model_Resource_Coupon')->updateSpecificCoupons($object);
     }
     return parent::_afterSave($object);
 }
开发者ID:natxetee,项目名称:magento2,代码行数:39,代码来源:Rule.php

示例5: _saveWebsiteIds

 /**
  * Save all website Ids associated to specified segment
  *
  * @deprecated after 1.11.2.0 use $this->bindRuleToEntity() instead
  *
  * @param Mage_Core_Model_Abstract|Enterprise_CustomerSegment_Model_Segment $segment
  *
  * @return Enterprise_CustomerSegment_Model_Resource_Segment
  */
 protected function _saveWebsiteIds($segment)
 {
     if ($segment->hasWebsiteIds()) {
         $websiteIds = $segment->getWebsiteIds();
         if (!is_array($websiteIds)) {
             $websiteIds = explode(',', (string) $websiteIds);
         }
         $this->bindRuleToEntity($segment->getId(), $websiteIds, 'website');
     }
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:20,代码来源:Segment.php


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