本文整理汇总了PHP中Mage_Core_Model_Resource_Db_Abstract::_afterDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Resource_Db_Abstract::_afterDelete方法的具体用法?PHP Mage_Core_Model_Resource_Db_Abstract::_afterDelete怎么用?PHP Mage_Core_Model_Resource_Db_Abstract::_afterDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Resource_Db_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Resource_Db_Abstract::_afterDelete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterDelete
/**
* Perform actions after object delete
*
* @param Varien_Object $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterDelete(Mage_Core_Model_Abstract $object)
{
$file = $this->getContentFile($object->getId());
if (file_exists($file)) {
@unlink($file);
}
return parent::_afterDelete($object);
}
示例2: _afterDelete
/**
* Method set default group id to the customers collection
*
* @param Mage_Core_Model_Abstract $group
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterDelete(Mage_Core_Model_Abstract $group)
{
$customerCollection = Mage::getResourceModel('Mage_Customer_Model_Resource_Customer_Collection')->addAttributeToFilter('group_id', $group->getId())->load();
foreach ($customerCollection as $customer) {
$defaultGroupId = Mage::helper('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($customer->getStoreId());
$customer->setGroupId($defaultGroupId);
$customer->save();
}
return parent::_afterDelete($group);
}
示例3: _afterDelete
/**
* Method set default group id to the customers collection
*
* @param Mage_Core_Model_Abstract $group
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterDelete(Mage_Core_Model_Abstract $group)
{
$customerCollection = Mage::getResourceModel('customer/customer_collection')->addAttributeToFilter('group_id', $group->getId())->load();
foreach ($customerCollection as $customer) {
$defaultGroupId = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $customer->getStoreId());
$customer->setGroupId($defaultGroupId);
$customer->save();
}
return parent::_afterDelete($group);
}
示例4: _afterDelete
/**
* Perform actions after object delete
* Prepare rating data for reaggregate all data for reviews
*
* @param Mage_Rating_Model_Rating $object
* @return Mage_Rating_Model_Resource_Rating
*/
protected function _afterDelete(Mage_Core_Model_Abstract $object)
{
parent::_afterDelete($object);
if (!Mage::helper('rating')->isModuleEnabled('Mage_Review')) {
return $this;
}
$data = $this->_getEntitySummaryData($object);
$summary = array();
foreach ($data as $row) {
$clone = clone $object;
$clone->addData($row);
$summary[$clone->getStoreId()][$clone->getEntityPkValue()] = $clone;
}
Mage::getResourceModel('review/review_summary')->reAggregate($summary);
return $this;
}
示例5: _afterDelete
/**
* Process data after delete
* Validate if this revision can be removed
*
* @param Mage_Core_Model_Abstract $object
* @return Enterprise_Cms_Model_Resource_Page_Revision
*/
protected function _afterDelete(Mage_Core_Model_Abstract $object)
{
$this->_aggregateVersionData((int) $object->getVersionId());
return parent::_afterDelete($object);
}
示例6: _afterDelete
/**
* After delete process
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Bundle_Model_Resource_Option
*/
protected function _afterDelete(Mage_Core_Model_Abstract $object)
{
parent::_afterDelete($object);
$this->_getWriteAdapter()->delete($this->getTable('bundle/option_value'), array('option_id = ?' => $object->getId()));
return $this;
}
示例7: _afterDelete
/**
* Perform actions after object delete.
* Delete layout updates by layout update ids collected in _beforeSave
*
* @param Mage_Widget_Model_Widget_Instance $object
* @return Mage_Widget_Model_Resource_Widget_Instance
*/
protected function _afterDelete(Mage_Core_Model_Abstract $object)
{
$this->_deleteLayoutUpdates($object->getLayoutUpdateIdsToDelete());
return parent::_afterDelete($object);
}
示例8: _afterDelete
/**
* @param Mage_Core_Model_Abstract $object
* @return $this
*/
protected function _afterDelete(Mage_Core_Model_Abstract $object)
{
$this->_generateCache();
return parent::_afterDelete($object);
}