Exemplo n.º 1
0
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $avatar = $this->owner->Avatar();
     if ($avatar && $avatar->exists()) {
         $avatar->delete();
     }
 }
 /**
  * Deletes some relations
  * 
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 10.05.2012 
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->getLanguageRelation() as $language) {
         $language->delete();
     }
 }
 /**
  * Remove the record from the translation group mapping.
  */
 public function onBeforeDelete()
 {
     // @todo Coupling to Versioned, we need to avoid removing
     // translation groups if records are just deleted from a stage
     // (="unpublished"). Ideally the translation group tables would
     // be specific to different Versioned changes, making this restriction unnecessary.
     // This will produce orphaned translation group records for SiteTree subclasses.
     if (!$this->owner->hasExtension('Versioned')) {
         $this->removeTranslationGroup();
     }
     parent::onBeforeDelete();
 }
 public function onBeforeDelete()
 {
     $conf = $this->FlexiFormConf();
     if ($conf->exists()) {
         $conf->delete();
     }
     return parent::onBeforeDelete();
 }
 /**
  * Remove the entry from the search table before deleting it
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $this->deleteDo($this->owner);
 }
 /**
  *
  */
 public function onBeforeDelete()
 {
     // delete the cache
     CacheHelper::get_cache()->remove($this->key());
     parent::onBeforeDelete();
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $this->dataChangeTrackService->track($this->owner, 'Delete');
 }
 public function onBeforeDelete()
 {
     if (self::$prevent_delete) {
         throw new Exception("Tried to delete a DataObject, but data deletion is currently active");
     }
     parent::onBeforeDelete();
 }
 function onBeforeDelete()
 {
     parent::onBeforeDelete();
     if (Versioned::get_by_stage("Product", "Stage", "Product.ID =" . $this->owner->ID)->count() == 0) {
         $variations = $this->owner->Variations();
         foreach ($variations as $variation) {
             if ($variation->canDelete()) {
                 $variation->delete();
             }
         }
     }
 }
 /**
  * Delete a member's backup tokens when deleting the member.
  */
 public function onBeforeDelete()
 {
     foreach ($this->owner->BackupTokens() as $bt) {
         $bt->delete();
     }
     parent::onBeforeDelete();
 }