public function setComment($id) { $id = intval($id); $message = $id > 0 ? \CForumMessage::getById($id) : null; if (!empty($message)) { if ($message["TOPIC_ID"] != $this->topic["ID"]) { throw new ArgumentException(Loc::getMessage("ACCESS_DENIED"), self::ERROR_PERMISSION); } $this->id = $id; $this->message = $message; } }