Exemple #1
0
 protected function getQuotedUsersComment(Comment $comment)
 {
     $body = $comment->getBody();
     $arrayUserId = [];
     preg_match_all('#\\[quote="([0-9]+)"\\].*[/quote]#', $body, $matches);
     if (isset($matches['1'])) {
         foreach ($matches['1'] as $q) {
             $arrayUserId[] = $q;
         }
     }
     return $arrayUserId;
 }
Exemple #2
0
 public function shortComment(Comment $post)
 {
     $res = $post->getBody();
     return strlen($res) > 150 ? mb_substr($res, 0, 150) . "..." : $res;
 }