function addReview($id) { $author = $this->app->request->post('author'); $text = $this->app->request->post('text'); $review = MovieReview::makeEmpty(); $review->setAuthor($author); $review->setText($text); $review->setMovieId($id); $review->save(); $this->app->flash('info', 'The review was successfully saved.'); $this->app->redirect('/movies/' . $id); }