예제 #1
0
파일: XWebUser.php 프로젝트: hung5s/yap
 /**
  * Get the User ActiveRecord object attached with application's user
  * @return XUser
  */
 public function getUserModel($reload = false)
 {
     if (!$this->model || $reload) {
         $this->model = Yii::createComponent($this->userClass);
         if ($this->id) {
             $this->model = $this->model->findByPk($this->id);
         }
         if (!$this->model) {
             $this->model = Yii::createComponent($this->userClass);
         }
     }
     return $this->model;
 }