public static function getById($commentId, $userId = null) { if ($comment = get_comment($commentId) and $comment->comment_type == self::COMMENT_TYPE) { if (empty($userId) or $comment->user_id == $userId) { $answer = new self($comment); if ($answer->getThread()) { return $answer; } } } }