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


PHP Ticket_User::constr_TUserId方法代碼示例

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


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

示例1: getRepliesOfTicket

 /**
  * return all replies on a specific ticket.
  * @param $ticket_id the id of the ticket of which we want the replies.
  * @param $view_as_admin if the browsing user is an admin/mod it should be 1, this will also show the hidden replies.
  * @return an array with ticket_reply objects (beware the author and content are objects on their own, not integers!)
  */
 public static function getRepliesOfTicket($ticket_id, $view_as_admin)
 {
     $dbl = new DBLayer("lib");
     $statement = $dbl->execute("SELECT * FROM ticket_reply INNER JOIN ticket_content INNER JOIN ticket_user ON ticket_reply.Content = ticket_content.TContentId and ticket_reply.Ticket=:id and ticket_user.TUserId = ticket_reply.Author ORDER BY ticket_reply.TReplyId ASC", array('id' => $ticket_id));
     $row = $statement->fetchAll();
     $result = array();
     foreach ($row as $tReply) {
         //only add hidden replies if the user is a mod/admin
         if (!$tReply['Hidden'] || $view_as_admin) {
             //load author
             $instanceAuthor = Ticket_User::constr_TUserId($tReply['Author']);
             $instanceAuthor->setExternId($tReply['ExternId']);
             $instanceAuthor->setPermission($tReply['Permission']);
             //load content
             $instanceContent = new Ticket_Content();
             $instanceContent->setTContentId($tReply['TContentId']);
             $instanceContent->setContent($tReply['Content']);
             //load reply and add the author and content object in it.
             $instanceReply = new self();
             $instanceReply->setTReplyId($tReply['TReplyId']);
             $instanceReply->setTimestamp($tReply['Timestamp']);
             $instanceReply->setAuthor($instanceAuthor);
             $instanceReply->setTicket($ticket_id);
             $instanceReply->setContent($instanceContent);
             $instanceReply->setHidden($tReply['Hidden']);
             $result[] = $instanceReply;
         }
     }
     return $result;
 }
開發者ID:ryzom,項目名稱:ryzomcore,代碼行數:36,代碼來源:ticket_reply.php

示例2: getLogsOfTicket

 /**
  * return all log entries related to a ticket.
  * @param $ticket_id the id of the ticket of which we want all related log entries returned.
  * @return an array of ticket_log objects, be aware that the author in the ticket_log object is a ticket_user object on its own (so not a simple integer).
  */
 public static function getLogsOfTicket($ticket_id)
 {
     $dbl = new DBLayer("lib");
     $statement = $dbl->execute("SELECT * FROM ticket_log INNER JOIN ticket_user ON ticket_log.Author = ticket_user.TUserId and ticket_log.Ticket=:id ORDER BY ticket_log.TLogId ASC", array('id' => $ticket_id));
     $row = $statement->fetchAll();
     $result = array();
     foreach ($row as $log) {
         $instanceAuthor = Ticket_User::constr_TUserId($log['Author']);
         $instanceAuthor->setExternId($log['ExternId']);
         $instanceAuthor->setPermission($log['Permission']);
         $instanceLog = new self();
         $instanceLog->setTLogId($log['TLogId']);
         $instanceLog->setTimestamp($log['Timestamp']);
         $instanceLog->setAuthor($instanceAuthor);
         $instanceLog->setTicket($ticket_id);
         $instanceLog->setQuery($log['Query']);
         $result[] = $instanceLog;
     }
     return $result;
 }
開發者ID:cls1991,項目名稱:ryzomcore,代碼行數:25,代碼來源:ticket_log.php


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