console/controllers/UserController.php
protected function getUser($user)
    {
        $userClass = $this->checkUserClass();
        if (is_numeric($user)) {
            $user = $userClass::find()->id($user)->one();
        } elseif (is_string($user) && strlen($user)) {
            $user = $userClass::find()->guid($user)->one();
        }
        if (!$user || $user->getIsNewRecord()) {
            throw new Exception('User Not Registered.');
        }
        return $user;
    }
protected function getUser($user)
    {
        $userClass = $this->checkUserClass();
        if (is_numeric($user)) {
            $user = $userClass::find()->id($user)->one();
        } elseif (is_string($user) && strlen($user)) {
            $user = $userClass::find()->guid($user)->one();
        }
        if (!$user || $user->getIsNewRecord()) {
            throw new Exception('User Not Registered.');
        }
        return $user;
    }
protected function getUser ( $ user ) { $ userClass = $ this -> checkUserClass ( ) ; if ( is_numeric ( $ user ) ) { $ user = $ userClass :: find ( ) -> id ( $ user ) -> one ( ) ; } elseif ( is_string ( $ user ) && strlen ( $ user ) ) { $ user = $ userClass :: find ( ) -> guid ( $ user ) -> one ( ) ; } if ( ! $ user || $ user -> getIsNewRecord ( ) ) { throw new Exception ( 'User Not Registered.' ) ; } return $ user ; }
Get user from database.
@param User|string|integer $user User ID.
@return User
@throws Exception
Get user from database .