本文整理汇总了PHP中Mage_Core_Model_Resource_Db_Abstract::_beforeDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Resource_Db_Abstract::_beforeDelete方法的具体用法?PHP Mage_Core_Model_Resource_Db_Abstract::_beforeDelete怎么用?PHP Mage_Core_Model_Resource_Db_Abstract::_beforeDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Resource_Db_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Resource_Db_Abstract::_beforeDelete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeDelete
/**
* Check if group uses as default
*
* @param Mage_Core_Model_Abstract $group
* @throws Mage_Core_Exception
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _beforeDelete(Mage_Core_Model_Abstract $group)
{
if ($group->usesAsDefault()) {
Mage::throwException(Mage::helper('Mage_Customer_Helper_Data')->__('The group "%s" cannot be deleted', $group->getCode()));
}
return parent::_beforeDelete($group);
}
示例2: _beforeDelete
/**
* Process cmspage data before delete
* update children count for parent cmspage
* delete child cmspages
*
* @access protected
* @param Varien_Object $object
* @return Ibrams_CmsExtended_Model_Resource_Cmspage
* @author Ultimate Module Creator
*/
protected function _beforeDelete(Mage_Core_Model_Abstract $object)
{
parent::_beforeDelete($object);
/**
* Update children count for all parent cmspages
*/
$parentIds = $object->getParentIds();
if ($parentIds) {
$childDecrease = $object->getChildrenCount() + 1;
// +1 is itself
$data = array('children_count' => new Zend_Db_Expr('children_count - ' . $childDecrease));
$where = array('entity_id IN(?)' => $parentIds);
$this->_getWriteAdapter()->update($this->getMainTable(), $data, $where);
}
$this->deleteChildren($object);
return $this;
}
示例3: _beforeDelete
/**
* Process page data before deleting
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Cms_Model_Resource_Page
*/
protected function _beforeDelete(Mage_Core_Model_Abstract $object)
{
$condition = array('page_id = ?' => (int) $object->getId());
$this->_getWriteAdapter()->delete($this->getTable('cms/page_store'), $condition);
return parent::_beforeDelete($object);
}
示例4: _beforeDelete
protected function _beforeDelete(Mage_Core_Model_Abstract $object)
{
$condition = array('theme_id = ?' => (int) $object->getId());
return parent::_beforeDelete($object);
}