Example #1
0
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = User::find(['username' => $this->username])->limit(1)->one();
     }
     return $this->_user;
 }
Example #2
0
 protected function findModel($id)
 {
     if (($model = User::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }