protected function _beforeDelete()
 {
     parent::_beforeDelete();
     foreach ($this->getImages() as $image) {
         Mage::getModel('stuntcoders_slideshow/slideshow_image')->setId($image['id'])->delete();
     }
     return $this;
 }
Пример #2
0
 protected function _beforeDelete()
 {
     if ($this->getId()) {
         $col = $this->getCollection()->addFieldToFilter('parent_id', $this->getId());
         foreach ($col as $item) {
             $item->delete();
         }
     }
     return parent::_beforeDelete();
 }
Пример #3
0
 protected function _beforeDelete()
 {
     $path = $this->getImagesPath();
     $objs = glob($path . "/*");
     foreach ($objs as $obj) {
         unlink($obj);
     }
     rmdir($path);
     //$this->createTumb();
     return parent::_beforeDelete();
 }
Пример #4
0
 /**
  * Clean related cache as instance contain layout updates
  */
 protected function _beforeDelete()
 {
     $this->_cleanCache();
     return parent::_beforeDelete();
 }
Пример #5
0
 protected function _beforeDelete()
 {
     $this->cleanCache();
     parent::_beforeDelete();
 }
Пример #6
0
 /**
  * Checking some moments before we can actually delete version
  *
  * @return Enterprise_Cms_Model_Page_Version
  */
 protected function _beforeDelete()
 {
     $resource = $this->_getResource();
     /* @var $resource Enterprise_Cms_Model_Mysql4_Page_Version */
     if ($this->isPublic()) {
         if ($resource->isVersionLastPublic($this)) {
             Mage::throwException(Mage::helper('enterprise_cms')->__('Version "%s" could not be removed because it is the last public version for its page.', $this->getLabel()));
         }
     }
     if ($resource->isVersionHasPublishedRevision($this)) {
         Mage::throwException(Mage::helper('enterprise_cms')->__('Version "%s" could not be removed because its revision has been published.', $this->getLabel()));
     }
     return parent::_beforeDelete();
 }
Пример #7
0
 protected function _beforeDelete()
 {
     AW_Kbase_Helper_Data::removeDirectory(AW_Kbase_Helper_Data::attachmentDirName($this->getId()));
     return parent::_beforeDelete();
 }
Пример #8
0
 /**
  * Processing theme before deleting data
  *
  * @throws Mage_Core_Exception
  * @return Mage_Core_Model_Theme
  */
 protected function _beforeDelete()
 {
     if (!$this->isDeletable()) {
         Mage::throwException(Mage::helper('Mage_Core_Helper_Data')->__('Current theme isn\'t deletable.'));
     }
     $this->removePreviewImage();
     return parent::_beforeDelete();
 }
Пример #9
0
 /**
  * Processing object before delete data
  *
  * @return Mage_Core_Model_Abstract
  * @throws Mage_Core_Exception
  */
 protected function _beforeDelete()
 {
     if ($this->_isInRule()) {
         Mage::throwException(Mage::helper('tax')->__('Tax rate cannot be removed. It exists in tax rule'));
     }
     return parent::_beforeDelete();
 }
Пример #10
0
 /**
  * Protect delete from non admin area
  *
  * Register indexing event before delete store
  *
  * @return Mage_Core_Model_Store
  */
 protected function _beforeDelete()
 {
     $this->_protectFromNonAdmin();
     Mage::getSingleton('index/indexer')->logEvent($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);
     return parent::_beforeDelete();
 }
Пример #11
0
 /**
  * @return $this
  */
 protected function _beforeDelete()
 {
     $this->_removeFile();
     return parent::_beforeDelete();
 }
Пример #12
0
 /**
  * Invalidate related cache if instance contain layout updates
  */
 protected function _beforeDelete()
 {
     if ($this->getPageGroups()) {
         $this->_invalidateCache();
     }
     return parent::_beforeDelete();
 }
 public function _beforeDelete()
 {
     if ($this->getStorage() == Mirasvit_Helpdesk_Model_Config::ATTACHMENT_STORAGE_FS) {
         unlink($this->getExternalPath());
     }
     return parent::_beforeDelete();
 }
Пример #14
0
 protected function _beforeDelete()
 {
     parent::_beforeDelete();
     $this->getAddressesCollection()->walk('delete');
     $this->getItemsCollection()->walk('delete');
     $this->getPaymentsCollection()->walk('delete');
 }
Пример #15
0
 /**
  * Finalize before deleting. Instances should sync with the gateway here.
  * 
  * Throw exception to abort.
  */
 protected function _beforeDelete()
 {
     return parent::_beforeDelete();
 }
Пример #16
0
 /**
  * Processing theme before deleting data
  *
  * @throws Mage_Core_Exception
  * @return Mage_Core_Model_Theme
  */
 protected function _beforeDelete()
 {
     if (!$this->isDeletable()) {
         Mage::throwException($this->_helper->__('Theme isn\'t deletable.'));
     }
     $this->removePreviewImage();
     return parent::_beforeDelete();
 }
 protected function _beforeDelete()
 {
     $field = Mage::getModel('helpdesk/field')->load($this->getId());
     $this->setDbCode($field->getCode());
     //unused???
     return parent::_beforeDelete();
 }
Пример #18
0
 /**
  * Perform checks before role delete
  *
  * @return Mage_Api2_Model_Acl_Global_Role
  */
 protected function _beforeDelete()
 {
     if (Mage_Api2_Model_Acl_Global_Role::isSystemRole($this)) {
         /** @var $helper Mage_Core_Helper_Data */
         $helper = Mage::helper('core');
         Mage::throwException(Mage::helper('api2')->__('%s role is a special one and can\'t be deleted.', $helper->escapeHtml($this->getRoleName())));
     }
     parent::_beforeDelete();
     return $this;
 }
 protected function _beforeDelete()
 {
     $messages = Mage::getModel('helpdesk/message')->getCollection()->addFieldToFilter('ticket_id', $this->getId());
     foreach ($messages as $message) {
         $message->delete();
     }
     return parent::_beforeDelete();
 }
Пример #20
0
 public function _beforeDelete()
 {
     $attachments = Mage::getModel('helpdesk/attachment')->getCollection()->addFieldToFilter('message_id', $this->getId());
     foreach ($attachments as $attachment) {
         $attachment->delete();
     }
     $emails = Mage::getModel('helpdesk/email')->getCollection()->addFieldToFilter('message_id', $this->getId());
     foreach ($emails as $email) {
         $email->delete();
     }
     return parent::_beforeDelete();
 }
Пример #21
0
 /**
  * check if page can be deleted
  *
  * @access protected
  * @return Ibrams_CmsExtended_Model_Page
  * @author Ultimate Module Creator
  */
 protected function _beforeDelete()
 {
     if ($this->getResource()->isForbiddenToDelete($this->getId())) {
         Mage::throwException(Mage::helper('ibrams_cmsextended')->__("Can't delete root page."));
     }
     return parent::_beforeDelete();
 }
Пример #22
0
 protected function _beforeDelete()
 {
     $this->_protectFromNonAdmin();
     return parent::_beforeDelete();
 }
Пример #23
0
 protected function _beforeDelete()
 {
     if ($this->getDefaultImage()) {
         // delete default image
         $path = Mage::helper('amfeed')->getDownloadPath('images', $this->getId() . '.jpg');
         Mage::helper('amfeed')->deleteFile($path);
         $this->setDefaultImage(0)->save();
     }
     $path = $this->getMainPath();
     if (file_exists($path)) {
         // delete feed file
         Mage::helper('amfeed')->deleteFile($path);
     }
     return parent::_beforeDelete();
 }