本文整理汇总了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);
}
}