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


PHP Mage_Core_Model_Mysql4_Abstract::_afterSave方法代码示例

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


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

示例1: _afterSave

 /**
  * Assign page to store views
  *
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     // Code that flushes cache goes here
     Mage::app()->cleanCache(array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG, Ves_BlockBuilder_Model_Block::CACHE_BLOCK_TAG));
     Mage::app()->cleanCache(array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG, Ves_BlockBuilder_Model_Block::CACHE_PAGE_TAG));
     return parent::_afterSave($object);
 }
开发者ID:booklein,项目名称:bookle,代码行数:12,代码来源:Template.php

示例2: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     $this->_updateGroupDefaultStore($object->getGroupId(), $object->getId());
     $this->_changeGroup($object);
     return $this;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:7,代码来源:Store.php

示例3: _afterSave

 /**
  * Assign page to store views
  *
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = $this->_getWriteAdapter()->quoteInto('post_id = ?', $object->getId());
     // process faq item to store relation
     $this->_getWriteAdapter()->delete($this->getTable('ves_blog/post_store'), $condition);
     $stores = $object->getData('stores');
     if ($stores) {
         foreach ((array) $object->getData('stores') as $store) {
             $storeArray = array();
             $storeArray['post_id'] = $object->getId();
             $storeArray['store_id'] = $store;
             $this->_getWriteAdapter()->insert($this->getTable('ves_blog/post_store'), $storeArray);
         }
     } else {
         $stores = $object->getStoreId();
         if ($stores) {
             foreach ((array) $stores as $store) {
                 $storeArray = array();
                 $storeArray['post_id'] = $object->getId();
                 $storeArray['store_id'] = $store;
                 $this->_getWriteAdapter()->insert($this->getTable('ves_blog/post_store'), $storeArray);
             }
         }
     }
     //Rewrite blog url
     $resroute = Mage::getStoreConfig('ves_blog/general_setting/route');
     $extension = ".html";
     Mage::getModel('core/url_rewrite')->loadByIdPath('venusblog/post/' . $object->getId())->setIdPath('venusblog/post/' . $object->getId())->setRequestPath($resroute . '/' . $object->getIdentifier() . $extension)->setTargetPath('venusblog/post/view/id/' . $object->getId())->save();
     return parent::_afterSave($object);
 }
开发者ID:booklein,项目名称:bookle,代码行数:35,代码来源:Post.php

示例4: _afterSave

 /**
  *
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = $this->_getWriteAdapter()->quoteInto('slider_id = ?', $object->getId());
     // Stores
     $this->_getWriteAdapter()->delete($this->getTable('auguria_sliders/stores'), $condition);
     foreach ((array) $object->getData('stores') as $store) {
         $storeArray = array();
         $storeArray['slider_id'] = $object->getId();
         $storeArray['store_id'] = $store;
         $this->_getWriteAdapter()->insert($this->getTable('auguria_sliders/stores'), $storeArray);
     }
     // Cms pages
     $this->_getWriteAdapter()->delete($this->getTable('auguria_sliders/pages'), $condition);
     foreach ((array) $object->getData('pages') as $page) {
         $pageArray = array();
         $pageArray['slider_id'] = $object->getId();
         $pageArray['page_id'] = $page;
         $this->_getWriteAdapter()->insert($this->getTable('auguria_sliders/pages'), $pageArray);
     }
     // Category ids
     $this->_getWriteAdapter()->delete($this->getTable('auguria_sliders/categories'), $condition);
     foreach ((array) $object->getData('category_ids') as $category) {
         $categoryArray = array();
         $categoryArray['slider_id'] = $object->getId();
         $categoryArray['category_id'] = $category;
         $this->_getWriteAdapter()->insert($this->getTable('auguria_sliders/categories'), $categoryArray);
     }
     return parent::_afterSave($object);
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:33,代码来源:Sliders.php

示例5: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     /** @var  Mirasvit_Helpdesk_Model_Status $object */
     if (!$object->getIsMassStatus()) {
     }
     return parent::_afterSave($object);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:7,代码来源:Status.php

示例6: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = $this->_getWriteAdapter()->quoteInto('news_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('news_store'), $condition);
     if (count($object->getData('stores')) && !in_array(0, (array) $object->getData('stores'))) {
         foreach ((array) $object->getData('stores') as $store) {
             $data = array();
             $data['news_id'] = $object->getId();
             $data['store_id'] = $store;
             $this->_getWriteAdapter()->insert($this->getTable('news_store'), $data);
         }
     } else {
         $data = array();
         $data['news_id'] = $object->getId();
         $data['store_id'] = '0';
         $this->_getWriteAdapter()->insert($this->getTable('news_store'), $data);
     }
     $condition = $this->_getWriteAdapter()->quoteInto('news_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('news_category'), $condition);
     foreach ((array) $object->getData('categories') as $category) {
         $data = array();
         $data['news_id'] = $object->getId();
         $data['category_id'] = $category;
         $this->_getWriteAdapter()->insert($this->getTable('news_category'), $data);
     }
     return parent::_afterSave($object);
 }
开发者ID:zloadmin,项目名称:modnyashka,代码行数:27,代码来源:News.php

示例7: _afterSave

 /**
  * Perform actions after object save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Eav_Model_Mysql4_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:codercv,项目名称:urbansurprisedev,代码行数:33,代码来源:Set.php

示例8: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = $this->_getWriteAdapter()->quoteInto('post_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('store'), $condition);
     if (!$object->getData('stores')) {
         $storeArray = array();
         $storeArray['post_id'] = $object->getId();
         $storeArray['store_id'] = '0';
         $this->_getWriteAdapter()->insert($this->getTable('store'), $storeArray);
     } else {
         foreach ((array) $object->getData('stores') as $store) {
             $storeArray = array();
             $storeArray['post_id'] = $object->getId();
             $storeArray['store_id'] = $store;
             $this->_getWriteAdapter()->insert($this->getTable('store'), $storeArray);
         }
     }
     $condition = $this->_getWriteAdapter()->quoteInto('post_id = ?', $object->getId());
     $this->_getWriteAdapter()->delete($this->getTable('post_cat'), $condition);
     foreach ((array) $object->getData('cats') as $store) {
         $storeArray = array();
         $storeArray['post_id'] = $object->getId();
         $storeArray['cat_id'] = $store;
         $this->_getWriteAdapter()->insert($this->getTable('post_cat'), $storeArray);
     }
     return parent::_afterSave($object);
 }
开发者ID:ausger,项目名称:myporto,代码行数:27,代码来源:Post.php

示例9: _afterSave

 /**
  * Assign page to store views
  *
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $condition = $this->_getWriteAdapter()->quoteInto('post_id = ?', $object->getId());
     // process faq item to store relation
     $this->_getWriteAdapter()->delete($this->getTable('ves_blog/post_store'), $condition);
     $stores = $object->getData('stores');
     if ($stores) {
         foreach ((array) $object->getData('stores') as $store) {
             $storeArray = array();
             $storeArray['post_id'] = $object->getId();
             $storeArray['store_id'] = $store;
             $this->_getWriteAdapter()->insert($this->getTable('ves_blog/post_store'), $storeArray);
         }
     } else {
         $stores = $object->getStoreId();
         if ($stores) {
             foreach ((array) $stores as $store) {
                 $storeArray = array();
                 $storeArray['post_id'] = $object->getId();
                 $storeArray['store_id'] = $store;
                 $this->_getWriteAdapter()->insert($this->getTable('ves_blog/post_store'), $storeArray);
             }
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:quanghuynt93,项目名称:VesSmartshop,代码行数:31,代码来源:Post.php

示例10: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     $writeAdapter = $this->_getWriteAdapter();
     $condition = $writeAdapter->quoteInto("post_id = ?", $object->getId());
     $writeAdapter->delete($this->getTable("store"), $condition);
     if ($object->getData("stores")) {
         foreach ((array) $object->getData("stores") as $store) {
             $storeArray = array();
             $storeArray["post_id"] = $object->getId();
             $storeArray["store_id"] = $store;
             $writeAdapter->insert($this->getTable("store"), $storeArray);
         }
     } else {
         $storeArray = array();
         $storeArray["post_id"] = $object->getId();
         $storeArray["store_id"] = Mage::app()->getStore(true)->getId();
         $writeAdapter->insert($this->getTable("store"), $storeArray);
     }
     $condition = $writeAdapter->quoteInto("post_id = ?", $object->getId());
     $writeAdapter->delete($this->getTable("post_cat"), $condition);
     foreach ((array) $object->getData("cats") as $catId) {
         $storeArray = array();
         $storeArray["post_id"] = $object->getId();
         $storeArray["cat_id"] = $catId;
         $writeAdapter->insert($this->getTable("post_cat"), $storeArray);
     }
     return parent::_afterSave($object);
 }
开发者ID:ikommerce,项目名称:fontis_blog,代码行数:28,代码来源:Post.php

示例11: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     parent::_afterSave($object);
     // process object to store relation
     $stores = $object->getData('store_id');
     if (is_array($stores)) {
         if (empty($stores) || in_array('0', $stores, true)) {
             $stores = array('0');
         }
     } else {
         $stores = array_map('intval', explode(',', strval($stores)));
     }
     $mode = $object->getData('mode');
     $exclCh = $object->getData('exclude_children');
     $priority = $object->getData(self::FIELD_PRIORITY);
     $groups = $object->getData(self::FIELD_GROUPS);
     if (is_array($groups)) {
         $groups = implode(',', $groups);
     } else {
         $groups = (string) $groups;
     }
     foreach ($stores as $store) {
         $this->_getWriteAdapter()->delete($this->_storeTable, $this->_getWriteAdapter()->quoteInto('hp_id = ?', $object->getId()) . ' AND ' . $this->_getWriteAdapter()->quoteInto('store_id = ?', $store));
         if (!$object->getData('delete')) {
             $this->_getWriteAdapter()->insert($this->_storeTable, array(self::FIELD_HP_ID => $object->getId(), self::FIELD_STORE_ID => $store, self::FIELD_HIDEPRICE_MODE => $mode, self::FIELD_IS_EXCL_CHILDREN => (int) (bool) $exclCh, self::FIELD_GROUPS => $groups, self::FIELD_PRIORITY => (int) $priority));
         }
     }
     return $this;
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:29,代码来源:Hideprice.php

示例12: _afterSave

 /**
  * Call-back function
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getIsMassStatus()) {
         $this->_saveToStoreTable($object);
     }
     return parent::_afterSave($object);
 }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:10,代码来源:Rewrite.php

示例13: _afterSave

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

示例14: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     /** @var  Mirasvit_Helpdesk_Model_Permission $object */
     if (!$object->getIsMassStatus()) {
         $this->saveDepartmentIds($object);
     }
     return parent::_afterSave($object);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:8,代码来源:Mirasvit_Helpdesk_Model_Resource_Permission.php

示例15: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     /** @var  Mirasvit_Helpdesk_Model_Template $object */
     if (!$object->getIsMassStatus()) {
         $this->saveStoreIds($object);
     }
     return parent::_afterSave($object);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:8,代码来源:Template.php


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