/** * Event handler called before deleting from the database. * @note we test for exceptions here and ignore them.. allowing the record to be deleted. * @note if the file has been remove from the file system updateFileSystem will throw an exception */ protected function onBeforeDelete() { try { parent::onBeforeDelete(); } catch (Exception $e) { } }
public function onBeforeDelete() { foreach ($this->AllChildren() as $child) { $child->delete(); } parent::onBeforeDelete(); }
protected function onBeforeDelete() { parent::onBeforeDelete(); if ($this->PreviewImage()->exists()) { $this->PreviewImage()->delete(); } foreach ($this->TimelineImages() as $Image) { $TimelineImagesFolder = $Image->Parent(); $Image->delete(); } $TimelineImagesFolder->delete(); }
protected function onBeforeDelete() { $backend = Injector::inst()->create(self::get_backend()); $backend->onBeforeDelete($this); $this->deleteFormattedImages(); parent::onBeforeDelete(); }
function onBeforeDelete() { if($this->ID && ($children = $this->AllChildren())) { foreach($children as $child) { if(!$this->Filename || !$this->Name || !file_exists($this->getFullPath())) { $child->setField('Name',null); $child->Filename = null; } $child->delete(); } } // Do this after so a folder's contents are removed before we delete the folder. if($this->Filename && $this->Name && file_exists($this->getFullPath())) { $files = glob( $this->getFullPath() . '/*' ); if( !$files || ( count( $files ) == 1 && preg_match( '/\/_resampled$/', $files[0] ) ) ) Filesystem::removeFolder( $this->getFullPath() ); } parent::onBeforeDelete(); }
protected function onBeforeDelete() { parent::onBeforeDelete(); $this->deleteFormattedImages(); }
protected function onBeforeDelete() { $backend = Injector::inst()->createWithArgs(self::config()->backend, array(Director::baseFolder() . "/" . $this->Filename)); $backend->onBeforeDelete($this); $this->deleteFormattedImages(); parent::onBeforeDelete(); }