Beispiel #1
0
 /**
  * @brief get the multiple comments(not paginating)
  **/
 function getComments($comment_srl_list, $columnList = array())
 {
     if (is_array($comment_srl_list)) {
         $comment_srls = implode(',', $comment_srl_list);
     }
     // fetch from a database
     $args = new stdClass();
     $args->comment_srls = $comment_srls;
     $output = executeQuery('comment.getComments', $args, $columnList);
     if (!$output->toBool()) {
         return;
     }
     $comment_list = $output->data;
     if (!$comment_list) {
         return;
     }
     if (!is_array($comment_list)) {
         $comment_list = array($comment_list);
     }
     $comment_count = count($comment_list);
     foreach ($comment_list as $key => $attribute) {
         if (!$attribute->comment_srl) {
             continue;
         }
         $oComment = null;
         $oComment = new commentItem();
         $oComment->setAttribute($attribute);
         if ($is_admin) {
             $oComment->setGrant();
         }
         $result[$attribute->comment_srl] = $oComment;
     }
     return $result;
 }
Beispiel #2
0
 /**
  * Get the comment
  * @param int $comment_srl
  * @param bool $is_admin
  * @param array $columnList
  * @return commentItem
  */
 function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array())
 {
     $oComment = new commentItem($comment_srl, $columnList);
     if ($is_admin) {
         $oComment->setGrant();
     }
     return $oComment;
 }