protected function findModel($id)
 {
     if (($model = Variable::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #2
0
 public function checkExist()
 {
     if ($this->isNewRecord || $this->id != $this->oldAttributes['id']) {
         $ret = Variable::findOne($this->id);
         return $ret !== null;
     }
     return false;
 }