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