public function addComment(\app\model\Comment $comment) { $successfulComment = false; $comments = $this->getAllComments(); try { $db = $this->db->getConnection(); $sql = "INSERT INTO {$this->dbTable} (" . self::$commenterColumn . ", " . self::$contentColumn . ", " . self::$venueIdentifierColumn . ", " . self::$timeStampColumn . ") VALUES (?, ?, ?, ?)"; $params = array($comment->getName(), $comment->getContent(), $comment->getVenueIdentifier(), $comment->getTimeStamp()); $query = $db->prepare($sql); $query->execute($params); $successfulComment = true; } catch (\PDOException $e) { die("Database error, please try again later"); } return $successfulComment; }