当前位置: 首页>>代码示例>>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;未经允许,请勿转载。