Пример #1
0
 /**
  * get user id from session and fill data into model
  * @return UserModel|null
  */
 public static function getDefault()
 {
     $cookie = Request::getAuthCookie();
     if ($cookie) {
         $uid = $_SESSION[$cookie];
         if (!$uid) {
             return null;
         }
         return UserModel::findById($uid);
     }
     return null;
 }