public function getUser($userId)
    {
        // Check if we've already retrieved this user.
        if (isset($this->userEntities[$userId])) {
            return $this->userEntities[$userId];
        }

        $query = $this->getUserQuery($userId);
        /** @var Entity\Users $userEntity */
        if ($userEntity = $this->findOneWith($query)) {
            $this->unsetSensitiveFields($userEntity);
        }

        // Remember the user
        $this->userEntities[$userId] = $userEntity;

        return $userEntity;
    }
public function getUser($userId)
    {
        // Check if we've already retrieved this user.
        if (isset($this->userEntities[$userId])) {
            return $this->userEntities[$userId];
        }

        $query = $this->getUserQuery($userId);
        /** @var Entity\Users $userEntity */
        if ($userEntity = $this->findOneWith($query)) {
            $this->unsetSensitiveFields($userEntity);
        }

        // Remember the user
        $this->userEntities[$userId] = $userEntity;

        return $userEntity;
    }
public function getUser ( $ userId ) { // Check if we've already retrieved this user. if ( isset ( $ this -> userEntities [ $ userId ] ) ) { return $ this -> userEntities [ $ userId ] ; } $ query = $ this -> getUserQuery ( $ userId ) ; /** @var Entity\Users $userEntity */ if ( $ userEntity = $ this -> findOneWith ( $ query ) ) { $ this -> unsetSensitiveFields ( $ userEntity ) ; } // Remember the user $ this -> userEntities [ $ userId ] = $ userEntity ; return $ userEntity ; }
Get a user.

@param string|int $userId either the user's ID, username, or email
address

@return Entity\Users|false
Get a user .