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