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; }
public function shortComment(Comment $post) { $res = $post->getBody(); return strlen($res) > 150 ? mb_substr($res, 0, 150) . "..." : $res; }