當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。