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


PHP Versions::delete_for_anchor方法代码示例

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


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

示例1: delete_related_to

 /**
  * delete items related to one anchor
  *
  * This function is invoked to ensure that the database is cleaned when some anchor is deleted.
  *
  * The delete_related_to hook is used to invoke any software extension bound as follows:
  * - id: 'shared/anchors.php#delete_related_to'
  * - type: 'include'
  * - parameters: string the reference that is deleted (e.g., 'section:123')
  *
  * @param string reference of the deleted anchor (e.g., 'article:12')
  */
 public static function delete_related_to($anchor)
 {
     global $context;
     // delete related articles
     Articles::delete_for_anchor($anchor);
     // delete related categories
     Categories::delete_for_anchor($anchor);
     // delete related comments
     include_once $context['path_to_root'] . 'comments/comments.php';
     Comments::delete_for_anchor($anchor);
     // delete related dates
     include_once $context['path_to_root'] . 'dates/dates.php';
     Dates::delete_for_anchor($anchor);
     // delete related files
     Files::delete_for_anchor($anchor);
     // delete related images
     include_once $context['path_to_root'] . 'images/images.php';
     Images::delete_for_anchor($anchor);
     // delete related links
     include_once $context['path_to_root'] . 'links/links.php';
     Links::delete_for_anchor($anchor);
     // delete related locations
     include_once $context['path_to_root'] . 'locations/locations.php';
     Locations::delete_for_anchor($anchor);
     // delete related sections
     Sections::delete_for_anchor($anchor);
     // delete related tables
     include_once $context['path_to_root'] . 'tables/tables.php';
     Tables::delete_for_anchor($anchor);
     // delete related versions
     include_once $context['path_to_root'] . 'versions/versions.php';
     Versions::delete_for_anchor($anchor);
     // delete memberships for this anchor
     Members::unlink_for_reference($anchor);
     // the delete_related_to hook
     if (is_callable(array('Hooks', 'include_scripts'))) {
         $context['text'] .= Hooks::include_scripts('shared/anchors.php#delete_related_to', $anchor);
     }
 }
开发者ID:rair,项目名称:yacs,代码行数:51,代码来源:anchors.php


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