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