当前位置: 首页>>代码示例>>PHP>>正文


PHP Document_Item::getID方法代码示例

本文整理汇总了PHP中Document_Item::getID方法的典型用法代码示例。如果您正苦于以下问题:PHP Document_Item::getID方法的具体用法?PHP Document_Item::getID怎么用?PHP Document_Item::getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document_Item的用法示例。


在下文中一共展示了Document_Item::getID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doSpecificMassiveActions

 /**
  * @see CommonDBTM::doSpecificMassiveActions()
  **/
 function doSpecificMassiveActions($input = array())
 {
     $res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
     switch ($input['action']) {
         case "add_document":
         case "add_document_item":
             $documentitem = new Document_Item();
             foreach ($input["item"] as $key => $val) {
                 if (isset($input['items_id'])) {
                     // Add items to documents
                     $input2 = array('itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"], 'documents_id' => $key);
                 } else {
                     if (isset($input['documents_id'])) {
                         // Add document to item
                         $input2 = array('itemtype' => $input["itemtype"], 'items_id' => $key, 'documents_id' => $input['documents_id']);
                     } else {
                         return false;
                     }
                 }
                 if ($documentitem->can(-1, 'w', $input2)) {
                     if ($documentitem->add($input2)) {
                         $res['ok']++;
                     } else {
                         $res['ko']++;
                     }
                 } else {
                     $res['noright']++;
                 }
             }
             break;
         case "remove_document":
         case "remove_document_item":
             foreach ($input["item"] as $key => $val) {
                 if (isset($input['items_id'])) {
                     // Remove item to documents
                     $input2 = array('itemtype' => $input["item_itemtype"], 'items_id' => $input["items_id"], 'documents_id' => $key);
                 } else {
                     if (isset($input['documents_id'])) {
                         // Remove contract to items
                         $input2 = array('itemtype' => $input["itemtype"], 'items_id' => $key, 'documents_id' => $input['documents_id']);
                     } else {
                         return false;
                     }
                 }
                 $docitem = new Document_Item();
                 if ($docitem->can(-1, 'w', $input2)) {
                     if ($item = getItemForItemtype($input2["itemtype"])) {
                         if ($item->getFromDB($input2['items_id'])) {
                             $doc = new self();
                             if ($doc->getFromDB($input2['documents_id'])) {
                                 if ($docitem->getFromDBForItems($doc, $item)) {
                                     if ($docitem->delete(array('id' => $docitem->getID()))) {
                                         $res['ok']++;
                                     } else {
                                         $res['ko']++;
                                     }
                                 } else {
                                     $res['ko']++;
                                 }
                             } else {
                                 $res['ko']++;
                             }
                         } else {
                             $res['ko']++;
                         }
                     } else {
                         $res['ko']++;
                     }
                 } else {
                     $res['noright']++;
                 }
             }
             break;
         default:
             return parent::doSpecificMassiveActions($input);
     }
     return $res;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:81,代码来源:document.class.php


注:本文中的Document_Item::getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。