本文整理匯總了PHP中access::delete_item方法的典型用法代碼示例。如果您正苦於以下問題:PHP access::delete_item方法的具體用法?PHP access::delete_item怎麽用?PHP access::delete_item使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類access
的用法示例。
在下文中一共展示了access::delete_item方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: item_deleted
static function item_deleted($item)
{
access::delete_item($item);
// Find any other albums that had the deleted item as the album cover and null it out.
// In some cases this may leave us with a missing album cover up in this item's parent
// hierarchy, but in most cases it'll work out fine.
foreach (ORM::factory("item")->where("album_cover_item_id", "=", $item->id)->find_all() as $parent) {
item::remove_album_cover($parent);
}
$parent = $item->parent();
if (!$parent->album_cover_item_id) {
// Assume that we deleted the album cover
if (batch::in_progress()) {
// Remember that this parent is missing an album cover, for later.
$batch_missing_album_cover = Session::instance()->get("batch_missing_album_cover", array());
$batch_missing_album_cover[$parent->id] = 1;
Session::instance()->set("batch_missing_album_cover", $batch_missing_album_cover);
} else {
// Choose the first viewable child as the new cover.
if ($child = $parent->viewable()->children(1)->current()) {
item::make_album_cover($child);
}
}
}
}
示例2: item_before_delete
static function item_before_delete($item)
{
access::delete_item($item);
}
示例3: item_deleted
static function item_deleted($item)
{
access::delete_item($item);
}