/** * Results of given poll. * @param integer $id * @return mixed * @throws NotFoundHttpException */ public function actionResults($id) { if (($model = PollRecord::findOne($id)) !== null) { return $this->render('results', compact('model')); } throw new NotFoundHttpException(Yii::t('back', 'The requested page does not exist.')); }
/** * Deletes Poll * @throws \Exception */ public function deletePoll() { /** @var $poll PollRecord */ if ($poll = PollRecord::findOne($this->item_id)) { $poll->delete(); } }