public static function getAttributes($threads, $session_user) { foreach ($threads as $thread) { $thread->username = User::getUsernameById($thread->user_id); $thread->comment = Comment::getByThreadId($thread->id); $thread->is_author = $thread->isAuthor($session_user); $thread->is_followed = Follow::isFollowed($thread->id, $session_user); } }