當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataObject::onBeforeDelete方法代碼示例

本文整理匯總了PHP中DataObject::onBeforeDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObject::onBeforeDelete方法的具體用法?PHP DataObject::onBeforeDelete怎麽用?PHP DataObject::onBeforeDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataObject的用法示例。


在下文中一共展示了DataObject::onBeforeDelete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onBeforeDelete

 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};");
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:7,代碼來源:OpenStackReleaseSupportedApiVersion.php

示例2: onBeforeDelete

 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Questions() as $q) {
         $q->delete();
     }
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:7,代碼來源:RSVPTemplate.php

示例3: onBeforeDelete

 protected function onBeforeDelete()
 {
     if ($this->ArchiveID && ($archive = $this->Archive())) {
         $archive->delete();
     }
     parent::onBeforeDelete();
 }
開發者ID:rodneyway,項目名稱:silverstripe-siteexporter,代碼行數:7,代碼來源:SiteExport.php

示例4: onBeforeDelete

 public function onBeforeDelete()
 {
     if (file_exists($this->getFullPath())) {
         unlink($this->getFullPath());
     }
     parent::onBeforeDelete();
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-versionedfiles,代碼行數:7,代碼來源:FileVersion.php

示例5: onBeforeDelete

 /**
  * Delete all connected Widgets when this WidgetArea gets deleted
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Widgets() as $widget) {
         $widget->delete();
     }
 }
開發者ID:hailwood,項目名稱:silverstripe-widgets,代碼行數:10,代碼來源:WidgetArea.php

示例6: onBeforeDelete

 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Children() as $term) {
         $term->delete();
     }
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-taxonomy,代碼行數:7,代碼來源:TaxonomyTerm.php

示例7: onBeforeDelete

 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Providers() as $Provider) {
         $Provider_ > delete();
     }
 }
開發者ID:andrelohmann,項目名稱:vagrant-cloud,代碼行數:7,代碼來源:BoxVersion.php

示例8: onBeforeDelete

 /**
  * 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();
     }
 }
開發者ID:dnadesign,項目名稱:silverstripe-shop_stock,代碼行數:12,代碼來源:ProductWarehouse.php

示例9: onBeforeDelete

 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Options() as $option) {
         $option->delete();
     }
 }
開發者ID:i-lateral,項目名稱:silverstripe-filterable,代碼行數:7,代碼來源:FilterGroup.php

示例10: onBeforeDelete

 /**
  * Before delete logic
  */
 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->Tasks() as $task) {
         $task->delete();
     }
 }
開發者ID:muskie9,項目名稱:todo-list,代碼行數:10,代碼來源:TodoList.php

示例11: onBeforeDelete

 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->SampleConfigurations() as $item) {
         $item->delete();
     }
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:7,代碼來源:OpenStackSampleConfigurationType.php

示例12: onBeforeDelete

 protected function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->RelatedNotes() as $item) {
         $item->delete();
     }
     $this->OpenStackComponents()->removeAll();
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:8,代碼來源:OpenStackSampleConfig.php

示例13: onBeforeDelete

 /**
  * 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.");
     }
 }
開發者ID:swipestreak,項目名稱:swipestreak,代碼行數:13,代碼來源:Config.php

示例14: onBeforeDelete

 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $deleted = new TypeformSubmission_Deleted();
     $deleted->TypeformID = $this->TypeformID;
     $deleted->ParentID = $this->ParentID;
     $deleted->write();
 }
開發者ID:dnadesign,項目名稱:silverstripe-typeform,代碼行數:8,代碼來源:TypeformSubmission.php

示例15: onBeforeDelete

	/**
	 * 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();
	}
開發者ID:neopba,項目名稱:silverstripe-book,代碼行數:13,代碼來源:SubmittedForm.php


注:本文中的DataObject::onBeforeDelete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。