public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     // delete related records ...
     DB::query("DELETE FROM OpenStackImplementationApiCoverageDraft where ReleaseSupportedApiVersionID = {$this->ID};");
     DB::query("DELETE FROM OpenStackImplementationApiCoverage where ReleaseSupportedApiVersionID = {$this->ID};");
 }
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Questions() as $q) {
         $q->delete();
     }
 }
 protected function onBeforeDelete()
 {
     if ($this->ArchiveID && ($archive = $this->Archive())) {
         $archive->delete();
     }
     parent::onBeforeDelete();
 }
 public function onBeforeDelete()
 {
     if (file_exists($this->getFullPath())) {
         unlink($this->getFullPath());
     }
     parent::onBeforeDelete();
 }
 /**
  * Delete all connected Widgets when this WidgetArea gets deleted
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Widgets() as $widget) {
         $widget->delete();
     }
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Children() as $term) {
         $term->delete();
     }
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Providers() as $Provider) {
         $Provider_ > delete();
     }
 }
 /**
  * Ensure all the stock is removed when we remove the warehouse
  *
  * @return void
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->StockedProducts() as $stock) {
         $stock->delete();
     }
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Options() as $option) {
         $option->delete();
     }
 }
Example #10
0
 /**
  * Before delete logic
  */
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Tasks() as $task) {
         $task->delete();
     }
 }
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->SampleConfigurations() as $item) {
         $item->delete();
     }
 }
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->RelatedNotes() as $item) {
         $item->delete();
     }
     $this->OpenStackComponents()->removeAll();
 }
Example #13
0
 /**
  * Don't let current or active config be deleted.
  *
  * @throws ValidationException
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $currentConfig = self::streak_config();
     if ($this->isInDB() && $currentConfig && $currentConfig->ID == $this->ID) {
         throw new ValidationException("Can't delete only or active config, please make another active config before deleting this one.");
     }
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $deleted = new TypeformSubmission_Deleted();
     $deleted->TypeformID = $this->TypeformID;
     $deleted->ParentID = $this->ParentID;
     $deleted->write();
 }
	/**
	 * Before we delete this form make sure we delete all the
	 * field values so that we don't leave old data round
	 *
	 */
	protected function onBeforeDelete() {
		if($this->FieldValues()) {
			foreach($this->FieldValues() as $value) {
				$value->delete();
			}
		}
		parent::onBeforeDelete();
	}
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     // Clean up customisations
     foreach ($this->Customisations() as $customisation) {
         $customisation->delete();
     }
 }
Example #17
0
 public function onBeforeDelete()
 {
     $children = PostmarkMessage::get()->filter('InReplyToID', $this->ID);
     foreach ($children as $child) {
         $child->delete();
     }
     parent::onBeforeDelete();
 }
 public function onBeforeDelete()
 {
     // Delete all options when this opbect is deleted
     foreach ($this->Options() as $option) {
         $option->delete();
     }
     parent::onBeforeDelete();
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     // Delete all children
     foreach ($this->ChildComments() as $comment) {
         $comment->delete();
     }
 }
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Tickets() as $t) {
         $t->delete();
     }
     $schedule = $this->getManyManyComponents('Schedule');
     $schedule->removeAll();
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     // delete all items that were attached
     $items = $this->Items();
     foreach ($items as $item) {
         $item->delete();
     }
 }
Example #22
0
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Steps() as $s) {
         $s->delete();
     }
     foreach ($this->EntitySurveys() as $e) {
         $e->delete();
     }
 }
Example #23
0
 /**
  * Before deleting a post make sure all attachments are also deleted
  */
 function onBeforeDelete()
 {
     parent::onBeforeDelete();
     if ($attachments = $this->Attachments()) {
         foreach ($attachments as $file) {
             $file->delete();
             $file->destroy();
         }
     }
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $dashboards = $this->Dashboards();
     if ($dashboards->count()) {
         foreach ($dashboards as $board) {
             $board->delete();
         }
     }
 }
	/**
	 * These actions are performed when delete() is called on this object.
	 */
	public function onBeforeDelete() {
		// delete dependent form steps and relation
		$steps = $this->FormSteps();
		if($steps) foreach($steps as $step) {
			$steps->remove($step);	// @TODO not sure if this is required (does delete() remove the relation too?)
			$step->delete();
		}
		
		parent::onBeforeDelete();
	}
Example #26
0
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     if ($this->RegistrationRequestID > 0) {
         $this->RegistrationRequest()->delete();
     }
     foreach ($this->Locations() as $location) {
         $location->delete();
     }
 }
Example #27
0
 /**
  * Find item options and delete them to clean up DB.
  * 
  * @see DataObject::onBeforeDelete()
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $itemOptions = DataObject::get('ItemOption', 'ItemID = ' . $this->ID);
     if ($itemOptions && $itemOptions->exists()) {
         foreach ($itemOptions as $itemOption) {
             $itemOption->delete();
             $itemOption->destroy();
         }
     }
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     // Remove our relations but leave the related objects for objects
     // that may be used by other objects.
     foreach ($this->Links() as $link) {
         $link->delete();
     }
     $this->Authors()->removeAll();
     $this->Keywords()->removeAll();
     $this->CompatibleVersions()->removeAll();
 }
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     //make sure that if we delete this option group, we reassign the group's option items to the 'None' group.
     $items = OptionItem::get()->filter(array('ProductOptionGroupID' => $this->ID));
     if (isset($items)) {
         $noneGroup = OptionGroup::get()->filter(array('Title' => 'Options'))->first();
         foreach ($items as $item) {
             $item->ProductOptionGroupID = $noneGroup->ID;
             $item->write();
         }
     }
 }
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Feedback() as $e) {
         $e->delete();
     }
     foreach ($this->RSVPSubmissions() as $e) {
         $e->delete();
     }
     $this->AllowedSummitTypes()->removeAll();
     $this->Sponsors()->removeAll();
     $this->Tags()->removeAll();
     $this->Attendees()->removeAll();
 }