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


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怎么用?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);
 }
开发者ID:natxetee,项目名称:magento2,代码行数:14,代码来源:Group.php

示例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;
 }
开发者ID:pboethig,项目名称:vagrant_puppet_magento,代码行数:27,代码来源:Cmspage.php

示例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);
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:12,代码来源:Page.php

示例4: _beforeDelete

 protected function _beforeDelete(Mage_Core_Model_Abstract $object)
 {
     $condition = array('theme_id = ?' => (int) $object->getId());
     return parent::_beforeDelete($object);
 }
开发者ID:ahsanmage,项目名称:vr,代码行数:5,代码来源:Theme.php


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