當前位置: 首頁>>代碼示例>>PHP>>正文


PHP access::delete_item方法代碼示例

本文整理匯總了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);
             }
         }
     }
 }
開發者ID:JasonWiki,項目名稱:docs,代碼行數:25,代碼來源:gallery_event.php

示例2: item_before_delete

 static function item_before_delete($item)
 {
     access::delete_item($item);
 }
開發者ID:xafr,項目名稱:gallery3,代碼行數:4,代碼來源:gallery_event.php

示例3: item_deleted

 static function item_deleted($item)
 {
     access::delete_item($item);
 }
開發者ID:andyst,項目名稱:gallery3,代碼行數:4,代碼來源:gallery_event.php


注:本文中的access::delete_item方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。