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


PHP comment::util_get_comments_array方法代碼示例

本文整理匯總了PHP中comment::util_get_comments_array方法的典型用法代碼示例。如果您正苦於以下問題:PHP comment::util_get_comments_array方法的具體用法?PHP comment::util_get_comments_array怎麽用?PHP comment::util_get_comments_array使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在comment的用法示例。


在下文中一共展示了comment::util_get_comments_array方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_list

 public static function get_list($_FORM = array())
 {
     // Two modes, 1: get all comments for an entity, eg a task
     if ($_FORM["entity"] && in_array($_FORM["entity"], array("project", "client", "task", "timeSheet")) && $_FORM["entityID"]) {
         $e = new $_FORM["entity"]();
         $e->set_id($_FORM["entityID"]);
         if ($e->select()) {
             // this ensures that the user can read the entity
             return comment::util_get_comments_array($_FORM["entity"], $_FORM["entityID"], $_FORM);
         }
         // Or 2: get all starred comments
     } else {
         if ($_FORM["starred"]) {
             $filter = comment::get_list_filter($_FORM);
             if (is_array($filter) && count($filter)) {
                 $filter = " WHERE " . implode(" AND ", $filter);
             }
             $q = "SELECT comment.*, commentCreatedUser as personID, clientContact.clientContactName\n              FROM comment \n         LEFT JOIN clientContact on comment.commentCreatedUserClientContactID = clientContact.clientContactID\n                 " . $filter . " \n          ORDER BY commentCreatedTime";
             $db = new db_alloc();
             $db->query($q);
             $people =& get_cached_table("person");
             while ($row = $db->next_record()) {
                 $e = new $row["commentMaster"]();
                 $e->set_id($row["commentMasterID"]);
                 $e->select();
                 $row["entity_link"] = $e->get_link();
                 $row["personID"] and $row["person"] = $people[$row["personID"]]["name"];
                 $row["clientContactName"] and $row["person"] = $row["clientContactName"];
                 $rows[] = $row;
             }
             has("timeSheetItem") and $tsi_rows = timeSheetItem::get_timeSheetItemComments(null, true);
             foreach ((array) $tsi_rows as $row) {
                 $t = new task();
                 $t->set_id($row["taskID"]);
                 $t->select();
                 $row["entity_link"] = $t->get_link();
                 $row["commentMaster"] = "Task";
                 $row["commentMasterID"] = $row["taskID"];
                 $row["commentCreatedTime"] = $row["date"];
                 $row["personID"] and $row["person"] = $people[$row["personID"]]["name"];
                 $rows[] = $row;
             }
             return (array) $rows;
         }
     }
 }
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:46,代碼來源:comment.inc.php

示例2: get_task_comments_array

 function get_task_comments_array()
 {
     $rows = comment::util_get_comments_array("task", $this->get_id());
     $rows or $rows = array();
     return $rows;
 }
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:6,代碼來源:task.inc.php


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