本文整理汇总了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);
}
示例2: _afterSave
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
parent::_afterSave($object);
$this->_updateGroupDefaultStore($object->getGroupId(), $object->getId());
$this->_changeGroup($object);
return $this;
}
示例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);
}
示例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);
}
示例5: _afterSave
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
/** @var Mirasvit_Helpdesk_Model_Status $object */
if (!$object->getIsMassStatus()) {
}
return parent::_afterSave($object);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例12: _afterSave
/**
* Call-back function
*/
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getIsMassStatus()) {
$this->_saveToStoreTable($object);
}
return parent::_afterSave($object);
}
示例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);
}
示例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);
}
示例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);
}