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


PHP Mage_Core_Model_Abstract::getStoreIds方法代码示例

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


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

示例1: _afterLoad

 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getStoreIds()) {
         $object->setStoreIds(explode(',', $object->getStoreIds()));
     } else {
         $object->setStoreIds(array(0));
     }
     return parent::_afterLoad($object);
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:9,代码来源:Trigger.php

示例2: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (is_array($object->getStoreIds())) {
         $object->setStoreIds(implode(',', $object->getStoreIds()));
     }
     if (is_array($object->getCustomerGroups())) {
         $object->setCustomerGroups(implode(',', $object->getCustomerGroups()));
     }
 }
开发者ID:commercekitchen,项目名称:dualeyewear-magento,代码行数:9,代码来源:Rule.php

示例3: _afterLoad

 /**
  * @param Mage_Core_Model_Abstract $object
  *
  * @return $this|Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if (strlen($object->getStoreIds()) > 0) {
         $object->setStoreIds(array_map('intval', explode(',', $object->getStoreIds())));
     } else {
         $object->setStoreIds(array());
     }
     return parent::_afterLoad($object);
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:14,代码来源:Department.php

示例4: _syncStore

 protected function _syncStore(Mage_Core_Model_Abstract $object)
 {
     $collection = Mage::getModel('menu/item')->getCollection()->addFieldToFilter('menu_id', $object->getId());
     foreach ($collection as $item) {
         $item->setStoreIds($object->getStoreIds())->save();
     }
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Menu.php

示例5: _afterLoad

 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     $productIds = '';
     if ($object->getId()) {
         if (!is_array($object->getStoreIds())) {
             $object->setStoreIds(explode(',', $object->getStoreIds()));
         }
         $groups = $object->getCustomerGroups();
         if ($groups) {
             $object->setCustomerGroups(explode(',', $groups));
         }
         $product = Mage::getResourceSingleton('downloads/relation')->getProductIds($object->getId());
         if ($product) {
             $productIds = implode(',', $product);
         }
         $object->setInProducts($productIds);
     }
     return parent::_afterLoad($object);
 }
开发者ID:commercekitchen,项目名称:dualeyewear-magento,代码行数:19,代码来源:Files.php

示例6: _afterSave

 public function _afterSave(Mage_Core_Model_Abstract $object)
 {
     /** stores */
     $deleteWhere = $this->_getWriteAdapter()->quoteInto('poll_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('poll/poll_store'), $deleteWhere);
     foreach ($object->getStoreIds() as $storeId) {
         $pollStoreData = array('poll_id' => $object->getId(), 'store_id' => $storeId);
         $this->_getWriteAdapter()->insert($this->getTable('poll/poll_store'), $pollStoreData);
     }
     /** answers */
     foreach ($object->getAnswers() as $answer) {
         $answer->setPollId($object->getId());
         $answer->save();
     }
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:15,代码来源:Poll.php

示例7: getData

 /**
  * Sets indexer metadata for product entities
  *
  * @param Mage_Core_Model_Abstract $product
  * @return array
  */
 public function getData(Mage_Core_Model_Abstract $product)
 {
     $data = array();
     $data['entity_id'] = $product->getEntityId();
     $data['type_id'] = $product->getTypeId();
     $data['store_id'] = $product->getStoreId();
     $data['store_ids'] = $product->getStoreIds();
     $data['name_suggest'] = $this->_prepareNameSuggestField($product);
     $data['name_suggest_static'] = $product->getNameSuggestInputIndexValue();
     return $data;
 }
开发者ID:adrianoaguiar,项目名称:magento-elasticsearch-module,代码行数:17,代码来源:Product.php

示例8: _afterSave

 /**
  * Set store data after saving model
  *
  * @param Mage_Core_Model_Abstract $object
  * @return $this
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->getId()) {
         $oldStores = $this->lookupStoreIds($object->getId());
         $newStores = (array) $object->getStoreIds();
         if (empty($newStores)) {
             $newStores = (array) $object->getStoreId();
         }
         $table = $this->getStoreTable();
         $insert = array_diff($newStores, $oldStores);
         $delete = array_diff($oldStores, $newStores);
         if ($delete) {
             $this->_getWriteAdapter()->delete($table, array($this->getIdFieldName() . ' = ?' => (int) $object->getId(), 'store_id IN (?)' => $delete));
         }
         if ($insert) {
             $data = array();
             foreach ($insert as $storeId) {
                 $data[] = array($this->getIdFieldName() => (int) $object->getId(), 'store_id' => (int) $storeId);
             }
             $this->_getWriteAdapter()->insertMultiple($table, $data);
         }
         if (!$object->getSkipReindex()) {
             $object->getResource()->reindexAll();
         }
     }
 }
开发者ID:Benjamin021,项目名称:magento-attribute-page,代码行数:32,代码来源:Abstract.php

示例9: saveManufacturerStore

 /**
  * Delete current manufacturer from the table zeon_manufacturer_store and then
  * insert to update "manufacturer to store" relations
  *
  * @param Mage_Core_Model_Abstract $object
  */
 public function saveManufacturerStore(Mage_Core_Model_Abstract $object)
 {
     /** stores */
     $deleteWhere = $this->_getReadAdapter()->quoteInto('manufacturer_id = ?', $object->getId());
     $this->_getReadAdapter()->delete($this->getTable('zeon_manufacturer/store'), $deleteWhere);
     foreach ($object->getStoreIds() as $storeId) {
         $manufacturerStoreData = array('manufacturer_id' => $object->getId(), 'store_id' => $storeId);
         $this->_getWriteAdapter()->insert($this->getTable('zeon_manufacturer/store'), $manufacturerStoreData);
     }
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:16,代码来源:Manufacturer.php

示例10: _afterSave

 /**
  * After save
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Innoexts_StorePricing_Model_Mysql4_Catalogrule_Rule
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($this->getVersionHelper()->isGe1700()) {
         if ($object->hasStoreIds()) {
             $storeIds = $object->getStoreIds();
             if (!is_array($storeIds)) {
                 $storeIds = explode(',', (string) $storeIds);
             }
             $this->bindRuleToEntity($object->getId(), $storeIds, 'store');
         }
     }
     parent::_afterSave($object);
     return $this;
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:21,代码来源:Rule.php

示例11: saveFaqStore

 /**
  * Delete current faq from the table zeon_faq_store and then
  * insert to update "faq to store" relations
  *
  * @param Mage_Core_Model_Abstract $object
  */
 public function saveFaqStore(Mage_Core_Model_Abstract $object)
 {
     /** stores */
     $deleteWhere = $this->_getReadAdapter()->quoteInto('faq_id = ?', $object->getId());
     $this->_getReadAdapter()->delete($this->getTable('zeon_faq/store'), $deleteWhere);
     foreach ($object->getStoreIds() as $storeId) {
         $faqStoreData = array('faq_id' => $object->getId(), 'store_id' => $storeId);
         $this->_getWriteAdapter()->insert($this->getTable('zeon_faq/store'), $faqStoreData);
         if ($storeId === '0') {
             break;
         }
     }
 }
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:19,代码来源:Faq.php


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