public function getModel() { if (($model = KefuSelfservice::findOne($this->_id)) !== null) { return $model; } else { throw new NotFoundHttpException(Yii::t('common', 'The requested page does not exist.')); } }
public function actionView($id) { return $this->render('selfservice-view', ['model' => KefuSelfservice::findOne(['id' => $id])]); }
/** * Finds the KefuSelfservice model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return KefuSelfservice the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = KefuSelfservice::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }