protected function findModel($id) { if (($model = Review::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested review does not exist.'); } }