コード例 #1
0
 public function save(MovieReview $movieReview)
 {
     $movieId = $movieReview->getMovieId();
     $author = $movieReview->getAuthor();
     $text = $movieReview->getText();
     if ($movieReview->getId() === null) {
         $query = "INSERT INTO moviereviews (movieid, author, text) " . "VALUES ('{$movieId}', '{$author}', '{$text}')";
     }
     return $this->db->exec($query);
 }