当前位置: 首页>>代码示例>>PHP>>正文


PHP DataObject::onAfterDelete方法代码示例

本文整理汇总了PHP中DataObject::onAfterDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObject::onAfterDelete方法的具体用法?PHP DataObject::onAfterDelete怎么用?PHP DataObject::onAfterDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataObject的用法示例。


在下文中一共展示了DataObject::onAfterDelete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onAfterDelete

 public function onAfterDelete()
 {
     parent::onAfterDelete();
     foreach ($this->Answers() as $answer) {
         $answer->delete();
     }
 }
开发者ID:dnadesign,项目名称:silverstripe-typeform,代码行数:7,代码来源:TypeformSubmission.php

示例2: onAfterDelete

 function onAfterDelete()
 {
     parent::onAfterDelete();
     // Force thread to recalculate it's most recent.
     if ($this->ThreadID) {
         $this->Thread()->updateLastPost();
     }
 }
开发者ID:RyeDesigns,项目名称:silverstripe-forum,代码行数:8,代码来源:Post.php

示例3: onAfterDelete

 public function onAfterDelete()
 {
     parent::onAfterDelete();
     // Trigger Deletion Of All Related MCListSegments On Event Deletion
     $segments = $this->owner->getComponents("MCListSegments");
     foreach ($segments as $segment) {
         $segment->delete();
     }
 }
开发者ID:quadra-digital,项目名称:silverstripe-mailchimp-module,代码行数:9,代码来源:MCEvent.php

示例4: onAfterDelete

 public function onAfterDelete()
 {
     parent::onAfterDelete();
     // Delete associated permission codes
     $codes = $this->Codes();
     foreach ($codes as $code) {
         $code->delete();
     }
 }
开发者ID:miamollie,项目名称:echoAerial,代码行数:9,代码来源:PermissionRole.php

示例5: onAfterDelete

 public function onAfterDelete()
 {
     parent::onAfterDelete();
     if ($values = $this->Perms->getValues()) {
         foreach ($values as $perm) {
             singleton('PermissionService')->clearPermCacheFor($this->getItem(), $perm);
         }
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-restrictedobjects,代码行数:9,代码来源:AccessAuthority.php

示例6: onAfterDelete

 function onAfterDelete()
 {
     // Need to flush cache to avoid outdated versionnumber references
     $this->flushCache();
     // Need to mark pages depending to this one as broken
     $dependentPages = $this->DependentPages();
     if ($dependentPages) {
         foreach ($dependentPages as $page) {
             // $page->write() calls syncLinkTracking, which does all the hard work for us.
             $page->write();
         }
     }
     parent::onAfterDelete();
 }
开发者ID:eLBirador,项目名称:AllAboutCity,代码行数:14,代码来源:SiteTree.php

示例7: onAfterDelete

 /**
  *
  */
 protected function onAfterDelete()
 {
     parent::onAfterDelete();
     if (isset($this->dataSource)) {
         $this->dataSource->delete();
     }
 }
开发者ID:heyday,项目名称:silverstripe-redirects,代码行数:10,代码来源:RedirectUrl.php

示例8: onAfterDelete

 /**
  * Delete any related config files
  */
 public function onAfterDelete()
 {
     parent::onAfterDelete();
     // Create a basic new environment config from a template
     if ($this->config()->get('allow_web_editing') && $this->envFileExists()) {
         unlink($this->getConfigFilename());
     }
     $deployments = $this->Deployments();
     if ($deployments && $deployments->exists()) {
         foreach ($deployments as $deployment) {
             $deployment->delete();
         }
     }
     $archives = $this->DataArchives();
     if ($archives && $archives->exists()) {
         foreach ($archives as $archive) {
             $archive->delete();
         }
     }
     $transfers = $this->DataTransfers();
     if ($transfers && $transfers->exists()) {
         foreach ($transfers as $transfer) {
             $transfer->delete();
         }
     }
     $pings = $this->Pings();
     if ($pings && $pings->exists()) {
         foreach ($pings as $ping) {
             $ping->delete();
         }
     }
     $create = $this->CreateEnvironment();
     if ($create && $create->exists()) {
         $create->delete();
     }
 }
开发者ID:silverstripe,项目名称:deploynaut,代码行数:39,代码来源:DNEnvironment.php

示例9: onAfterDelete

 /**
  * Delete any related config files
  */
 public function onAfterDelete()
 {
     parent::onAfterDelete();
     // Create a basic new environment config from a template
     if ($this->config()->get('allow_web_editing') && $this->envFileExists()) {
         unlink($this->getConfigFilename());
     }
     $create = $this->CreateEnvironment();
     if ($create && $create->exists()) {
         $create->delete();
     }
 }
开发者ID:udomsak,项目名称:deploynaut,代码行数:15,代码来源:DNEnvironment.php

示例10: onAfterDelete

 public function onAfterDelete()
 {
     parent::onAfterDelete();
     if (Versioned::current_stage() == 'Stage') {
         $this->Pages()->removeAll();
         $this->BlockSets()->removeAll();
     }
 }
开发者ID:mhssmnn,项目名称:silverstripe-blocks,代码行数:8,代码来源:Block.php

示例11: onAfterDelete

 /**
  * Updates link tracking.
  */
 protected function onAfterDelete()
 {
     parent::onAfterDelete();
     $brokenPages = $this->BackLinkTracking();
     if ($brokenPages) {
         $origStage = Versioned::current_stage();
         // This will syncLinkTracking on draft
         Versioned::reading_stage('Stage');
         foreach ($brokenPages as $brokenPage) {
             $brokenPage->write();
         }
         // This will syncLinkTracking on published
         Versioned::reading_stage('Live');
         foreach ($brokenPages as $brokenPage) {
             $brokenPage->write();
         }
         Versioned::reading_stage($origStage);
     }
 }
开发者ID:hamishcampbell,项目名称:silverstripe-sapphire,代码行数:22,代码来源:File.php

示例12: onAfterDelete

 /**
  * API Callback after this object is removed from to the DB
  *
  */
 public function onAfterDelete()
 {
     parent::onAfterDelete();
     foreach ($this->Items() as $item) {
         $item->delete();
     }
 }
开发者ID:helpfulrobot,项目名称:i-lateral-silverstripe-commerce,代码行数:11,代码来源:Order.php

示例13: onAfterDelete

 /**
  * When deleting an action from a workflow definition, make sure that workflows currently paused on that action
  * are deleted
  * Also removes all outbound transitions
  */
 public function onAfterDelete()
 {
     parent::onAfterDelete();
     $wfActionInstances = WorkflowActionInstance::get()->leftJoin("WorkflowInstance", '"WorkflowInstance"."ID" = "WorkflowActionInstance"."WorkflowID"')->where(sprintf('"BaseActionID" = %d AND ("WorkflowStatus" IN (\'Active\',\'Paused\'))', $this->ID));
     foreach ($wfActionInstances as $wfActionInstance) {
         $wfInstances = WorkflowInstance::get()->filter('CurrentActionID', $wfActionInstance->ID);
         foreach ($wfInstances as $wfInstance) {
             $wfInstance->Groups()->removeAll();
             $wfInstance->Users()->removeAll();
             $wfInstance->delete();
         }
         $wfActionInstance->delete();
     }
     // Delete outbound transitions
     $transitions = WorkflowTransition::get()->filter('ActionID', $this->ID);
     foreach ($transitions as $transition) {
         $transition->Groups()->removeAll();
         $transition->Users()->removeAll();
         $transition->delete();
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-embargoexpiry,代码行数:26,代码来源:WorkflowAction.php

示例14: onAfterDelete

	function onAfterDelete() {
		// Need to flush cache to avoid outdated versionnumber references
		$this->flushCache();
		
		parent::onAfterDelete();
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:6,代码来源:SiteTree.php

示例15: onAfterDelete

 public function onAfterDelete()
 {
     parent::onAfterDelete();
     $this->ScheduledJob()->delete();
 }
开发者ID:tim-lar,项目名称:silverstripe-queuedjobs,代码行数:5,代码来源:QueuedTask.php


注:本文中的DataObject::onAfterDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。