private function setComment() { $comment = new model_comment(); $comment->ip = $_SERVER['REMOTE_ADDR']; $comment->content = parent::request('content'); if (trim($comment->content) == '') { return; } $commentId = model_comment::set($comment); if (isset($commentId) && !empty($commentId)) { $comment = model_comment::getByID($commentId); require_once 'view/html/index/index.comment.phtml'; } }
/** * Get a comment, optionally a specific instance. * * @access public * @param string $parentId * @param string $commentId * @throws Exception * @return model_comment */ public function getComment($parentId, $commentId = null) { if (!$this->exists()) { throw new Exception('Invalid data.', 62); } $comment = new model_comment($this->_conf, $this->_store); $comment->setPaste($this); $comment->setParentId($parentId); if ($commentId !== null) { $comment->setId($commentId); } return $comment; }