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


PHP Mage_Core_Model_Resource_Db_Abstract::_afterSave方法代码示例

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


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

示例1: _afterSave

 /**
  * Perform actions after object save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Eav_Model_Resource_Entity_Attribute_Set
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->getGroups()) {
         /* @var $group Mage_Eav_Model_Entity_Attribute_Group */
         foreach ($object->getGroups() as $group) {
             $group->setAttributeSetId($object->getId());
             if ($group->itemExists() && !$group->getId()) {
                 continue;
             }
             $group->save();
         }
     }
     if ($object->getRemoveGroups()) {
         foreach ($object->getRemoveGroups() as $group) {
             /* @var $group Mage_Eav_Model_Entity_Attribute_Group */
             $group->delete();
         }
         Mage::getResourceModel('eav/entity_attribute_group')->updateDefaultGroup($object->getId());
     }
     if ($object->getRemoveAttributes()) {
         foreach ($object->getRemoveAttributes() as $attribute) {
             /* @var $attribute Mage_Eav_Model_Entity_Attribute */
             $attribute->deleteEntity();
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:33,代码来源:Set.php

示例2: _afterSave

 /**
  * Update Store Group data after save store
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Store
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     $this->_updateGroupDefaultStore($object->getGroupId(), $object->getId());
     $this->_changeGroup($object);
     return $this;
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:13,代码来源:Store.php

示例3: _afterSave

 /**
  * Update a "layout update link" if relevant data is provided
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Layout
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $data = $object->getData();
     if (isset($data['store_id']) && isset($data['area']) && isset($data['package']) && isset($data['theme'])) {
         $this->_getWriteAdapter()->insertOnDuplicate($this->getTable('core_layout_link'), array('store_id' => $data['store_id'], 'area' => $data['area'], 'package' => $data['package'], 'theme' => $data['theme'], 'layout_update_id' => $object->getId()));
     }
     return parent::_afterSave($object);
 }
开发者ID:nemphys,项目名称:magento2,代码行数:14,代码来源:Layout.php

示例4: _afterSave

 /**
  * Assign shipping rule to store views and linking rules
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $this->_addLinkStores($object);
     if ($object->hasCustomMethodRules()) {
         $rules = Mage::helper('adminhtml/js')->decodeGridSerializedInput($object->getCustomMethodRules());
         $this->_addLinkRules($object, $rules);
     }
     return parent::_afterSave($object);
 }
开发者ID:xiaoguizhidao,项目名称:easy-shipping-rules,代码行数:16,代码来源:Custommethod.php

示例5: _afterSave

 /**
  * Processing object after save data
  * Update app_code as Store + Device + 123 (increment).
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Abstract
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $appCode = $object->getCode();
     $isCodePrefixed = $object->isCodePrefixed();
     if (!$isCodePrefixed) {
         $this->_getWriteAdapter()->update($this->getMainTable(), array('code' => $appCode . $object->getId()), $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()));
     }
     return parent::_afterSave($object);
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:16,代码来源:Application.php

示例6: _afterSave

 /**
  * Update a "layout update link" if relevant data is provided
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Layout
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $data = $object->getData();
     if (isset($data['store_id']) && isset($data['area']) && isset($data['package']) && isset($data['theme'])) {
         $this->_getWriteAdapter()->insertOnDuplicate($this->getTable('core_layout_link'), array('store_id' => $data['store_id'], 'area' => $data['area'], 'package' => $data['package'], 'theme' => $data['theme'], 'layout_update_id' => $object->getId()));
     }
     Mage::app()->cleanCache(array('layout', Mage_Core_Model_Layout_Merge::LAYOUT_GENERAL_CACHE_TAG));
     return parent::_afterSave($object);
 }
开发者ID:nayanchamp,项目名称:magento2,代码行数:15,代码来源:Update.php

示例7: _afterSave

 /**
  * Perform actions after object save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Website
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->getIsDefault()) {
         $this->_getWriteAdapter()->update($this->getMainTable(), array('is_default' => 0));
         $where = array('website_id = ?' => $object->getId());
         $this->_getWriteAdapter()->update($this->getMainTable(), array('is_default' => 1), $where);
     }
     return parent::_afterSave($object);
 }
开发者ID:monkviper,项目名称:magento-lite,代码行数:15,代码来源:Website.php

示例8: _afterSave

 /**
  * Perform actions after object save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->getAttributes()) {
         foreach ($object->getAttributes() as $attribute) {
             $attribute->setAttributeGroupId($object->getId());
             $attribute->save();
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:16,代码来源:Group.php

示例9: _afterSave

 /**
  * Method to run after save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = array('agreement_id = ?' => $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('checkout/agreement_store'), $condition);
     foreach ((array) $object->getData('stores') as $store) {
         $storeArray = array();
         $storeArray['agreement_id'] = $object->getId();
         $storeArray['store_id'] = $store;
         $this->_getWriteAdapter()->insert($this->getTable('checkout/agreement_store'), $storeArray);
     }
     return parent::_afterSave($object);
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:18,代码来源:Agreement.php

示例10: _afterSave

 /**
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = $this->_getWriteAdapter()->quoteInto('slider_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('slider/slider_store'), $condition);
     foreach ((array) $object->getData('stores') as $store) {
         $storeArray = array();
         $storeArray['slider_id'] = $object->getId();
         $storeArray['store_id'] = $store;
         $this->_getWriteAdapter()->insert($this->getTable('slider/slider_store'), $storeArray);
     }
     return parent::_afterSave($object);
 }
开发者ID:robinbortlik,项目名称:magento-dc-slider,代码行数:16,代码来源:Slider.php

示例11: _beforeSave

 /**
  * Prepare system report data to be saved
  *
  * @param Mage_Core_Model_Abstract $object
  *
  * @return Enterprise_Support_Model_Resource_Sysreport
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $object->setClientHost($this->getTool()->getClientHost());
     $object->setReportVersion($this->getTool()->getVersion());
     $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     $object->setMagentoVersion(Mage::getVersion());
     $types = $object->getReportTypes();
     $flags = $this->_dataHelper->getSysReportCommandsListByReportTypes($types);
     $object->setReportFlags(implode(',', $flags));
     $object->setReportTypes(implode(',', $types));
     $object->setReportData(serialize($object->getReportData()));
     parent::_afterSave($object);
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:21,代码来源:Sysreport.php

示例12: _afterSave

 /**
  * Perform actions after object save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Variable
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     if ($object->getUseDefaultValue()) {
         /*
          * remove store value
          */
         $this->_getWriteAdapter()->delete($this->getTable('core/variable_value'), array('variable_id = ?' => $object->getId(), 'store_id = ?' => $object->getStoreId()));
     } else {
         $data = array('variable_id' => $object->getId(), 'store_id' => $object->getStoreId(), 'plain_value' => $object->getPlainValue(), 'html_value' => $object->getHtmlValue());
         $data = $this->_prepareDataForTable(new Varien_Object($data), $this->getTable('core/variable_value'));
         $this->_getWriteAdapter()->insertOnDuplicate($this->getTable('core/variable_value'), $data, array('plain_value', 'html_value'));
     }
     return $this;
 }
开发者ID:quyip8818,项目名称:Mag,代码行数:21,代码来源:Variable.php

示例13: _afterSave

 /**
  * Save assigned processes
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Index_Model_Resource_Event
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $processIds = $object->getProcessIds();
     if (is_array($processIds)) {
         $processTable = $this->getTable('index/process_event');
         if (empty($processIds)) {
             $this->_getWriteAdapter()->delete($processTable);
         } else {
             foreach ($processIds as $processId => $processStatus) {
                 $data = array('process_id' => $processId, 'event_id' => $object->getId(), 'status' => $processStatus);
                 $this->_getWriteAdapter()->insertOnDuplicate($processTable, $data, array('status'));
             }
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:22,代码来源:Event.php

示例14: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->hasStoreLabels()) {
         $labels = $object->getStoreLabels();
         $this->_getWriteAdapter()->delete($this->_labelsTable, array('status = ?' => $object->getStatus()));
         $data = array();
         foreach ($labels as $storeId => $label) {
             if (empty($label)) {
                 continue;
             }
             $data[] = array('status' => $object->getStatus(), 'store_id' => $storeId, 'label' => $label);
         }
         if (!empty($data)) {
             $this->_getWriteAdapter()->insertMultiple($this->_labelsTable, $data);
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:VinuWebtech,项目名称:production267,代码行数:18,代码来源:Status.php

示例15: _afterSave

 /**
  * After save process
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Bundle_Model_Resource_Option
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     $condition = array('option_id = ?' => $object->getId(), 'store_id = ? OR store_id = 0' => $object->getStoreId());
     $write = $this->_getWriteAdapter();
     $write->delete($this->getTable('bundle/option_value'), $condition);
     $data = new Varien_Object();
     $data->setOptionId($object->getId())->setStoreId($object->getStoreId())->setTitle($object->getTitle());
     $write->insert($this->getTable('bundle/option_value'), $data->getData());
     /**
      * also saving default value if this store view scope
      */
     if ($object->getStoreId()) {
         $data->setStoreId(0);
         $data->setTitle($object->getDefaultTitle());
         $write->insert($this->getTable('bundle/option_value'), $data->getData());
     }
     return $this;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:25,代码来源:Option.php


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