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


PHP DataExtension::onBeforeDelete方法代碼示例

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


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

示例1: onBeforeDelete

 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $avatar = $this->owner->Avatar();
     if ($avatar && $avatar->exists()) {
         $avatar->delete();
     }
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-forum,代碼行數:8,代碼來源:ForumRole.php

示例2: onBeforeDelete

 /**
  * Deletes some relations
  * 
  * @return void
  *
  * @author Sebastian Diel <sdiel@pixeltricks.de>
  * @since 10.05.2012 
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     foreach ($this->getLanguageRelation() as $language) {
         $language->delete();
     }
 }
開發者ID:silvercart,項目名稱:silvercart,代碼行數:15,代碼來源:SilvercartDataObjectMultilingualDecorator.php

示例3: onBeforeDelete

 /**
  * Remove the record from the translation group mapping.
  */
 public function onBeforeDelete()
 {
     // @todo Coupling to Versioned, we need to avoid removing
     // translation groups if records are just deleted from a stage
     // (="unpublished"). Ideally the translation group tables would
     // be specific to different Versioned changes, making this restriction unnecessary.
     // This will produce orphaned translation group records for SiteTree subclasses.
     if (!$this->owner->hasExtension('Versioned')) {
         $this->removeTranslationGroup();
     }
     parent::onBeforeDelete();
 }
開發者ID:camfindlay,項目名稱:silverstripe-translatable,代碼行數:15,代碼來源:Translatable.php

示例4: onBeforeDelete

 public function onBeforeDelete()
 {
     $conf = $this->FlexiFormConf();
     if ($conf->exists()) {
         $conf->delete();
     }
     return parent::onBeforeDelete();
 }
開發者ID:helpfulrobot,項目名稱:briceburg-silverstripe-flexiform,代碼行數:8,代碼來源:FlexiFormExtension.php

示例5: onBeforeDelete

 /**
  * Remove the entry from the search table before deleting it
  */
 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $this->deleteDo($this->owner);
 }
開發者ID:souldigital,項目名稱:silverstripe-searchable-dataobjects,代碼行數:8,代碼來源:SearchableDataObject.php

示例6: onBeforeDelete

 /**
  *
  */
 public function onBeforeDelete()
 {
     // delete the cache
     CacheHelper::get_cache()->remove($this->key());
     parent::onBeforeDelete();
 }
開發者ID:notthatbad,項目名稱:silverstripe-caching,代碼行數:9,代碼來源:CacheableExtension.php

示例7: onBeforeDelete

 public function onBeforeDelete()
 {
     parent::onBeforeDelete();
     $this->dataChangeTrackService->track($this->owner, 'Delete');
 }
開發者ID:nathanbrauer,項目名稱:datachange-tracker,代碼行數:5,代碼來源:ChangeRecordable.php

示例8: onBeforeDelete

 public function onBeforeDelete()
 {
     if (self::$prevent_delete) {
         throw new Exception("Tried to delete a DataObject, but data deletion is currently active");
     }
     parent::onBeforeDelete();
 }
開發者ID:lekoala,項目名稱:silverstripe-softdelete,代碼行數:7,代碼來源:SoftDeletable.php

示例9: onBeforeDelete

 function onBeforeDelete()
 {
     parent::onBeforeDelete();
     if (Versioned::get_by_stage("Product", "Stage", "Product.ID =" . $this->owner->ID)->count() == 0) {
         $variations = $this->owner->Variations();
         foreach ($variations as $variation) {
             if ($variation->canDelete()) {
                 $variation->delete();
             }
         }
     }
 }
開發者ID:TouchtechLtd,項目名稱:silverstripe-ecommerce_product_variation,代碼行數:12,代碼來源:ProductWithVariationDecorator.php

示例10: onBeforeDelete

 /**
  * Delete a member's backup tokens when deleting the member.
  */
 public function onBeforeDelete()
 {
     foreach ($this->owner->BackupTokens() as $bt) {
         $bt->delete();
     }
     parent::onBeforeDelete();
 }
開發者ID:camfindlay,項目名稱:silverstripe-twofactorauth,代碼行數:10,代碼來源:Member.php


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