Returns the user that created the category

@param   boolean  $modified_user  Returns the modified_user when set to true

@return  JUser  A JUser object containing a userid

@since   11.1
550508
public function getAuthor($modified_user = false)
	{
		if ($modified_user)
		{
			return JFactory::getUser($this->modified_user_id);
		}

		return JFactory::getUser($this->created_user_id);
	}
1362878
private function checkActivatedStatus(User $user)
    {
        if (!$user->isActivated()) {
            throw new DisabledException(sprintf('Account `%s`is disabled.', $user->getUsername()));
        }

        return $user;
    }
906670
private function getCurrentUser()
    {
        if (is_object($token = $this->get('security.token_storage')->getToken()) and is_object($user = $token->getUser())) {
            return $user;
        }
    }
1050464
public function findAuthenticatedUser()
    {

        $token = $this->getSecurityTokenStorage()->getToken();

        if (null !== $token) {

            $user = $token->getUser();

            if (is_object($user) && $user instanceof UserInterface) {
                return $user;
            }

        }
        return null;
    }
462063
public function user()
    {
        // if the user was explicitly marked as logged out.
        if ($this->loggedOut) {
            // just return null.
            return null;
        }

        // if the user is already set.
        if ($this->user) {
            return $this->user;
        }

        // detects a token presence.
        $token = $this->detectedToken();

        // if the received token is not actually valid.
        if (!$token || !$this->manager->validToken($token)) {
            // also return null since the token
            // signature could not be determined.
            return null;
        }

        // if the token has expired.
        if ($this->manager->expired($token)) {
            // you got right?
            return null;
        }

        // try to find the user which the token belongs to.
        $user = $this->findUserByToken($token);

        // if the user has not been found.
        if (!$user) {
            // abort!
            return null;
        }

        // set the current user on the scope.
        $this->setUser($user);

        // return the scope user.
        return $this->user;
    }
428215
public function findDraft($user)
    {
        if ($user instanceof UserInterface) {
            $user = $user->getId();
        }

        return $this->findOneDraftBy(['user' => $user]);
    }
888804
public function getUser()
    {
        if ($this->_user === false) {
            $customerClass = Yincart::$container->customerClass;
            $this->_user = $customerClass::findByUsername($this->username);
        }

        return $this->_user;
    }
207776
public function getUser()
    {
        if (null === $token = $this->securityContext->getToken()) {
            return;
        }

        if (!is_object($user = $token->getUser())) {
            return;
        }

        return $user;
    }
551156
public function user()
    {
        if ($this->user !== null) {
            return $this->user;
        }

        if ($this->jwt->setRequest($this->request)->getToken() &&
            ($payload = $this->jwt->check(true)) &&
            $this->validateSubject()
        ) {
            return $this->user = $this->provider->retrieveById($payload['sub']);
        }
    }
557126
public function getUser() : ?User
    {
        $key = $this->getUserId();

        if (empty($key)) {
           return null;
        }

        return User::Store()->getById($key);
    }
736358
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = User::findByUsername($this->username);
        }

        return $this->_user;
    }
200330
private function getCurrentUserID($required)
    {
        $result = null;
        if (User::isLoggedIn()) {
            $u = new User();
            if ($u->isRegistered()) {
                $uID = (int) $u->getUserID();
                if ($uID !== 0) {
                    $result = $uID;
                }
            }
        }

        if ($result === null && $required) {
            throw new UserMessageException(t('No logged in user'));
        }

        return $result;
    }
1277760
public function getAllAction(User $loggedUser)
    {
        $this->checkPortfolioToolAccess();

        $response = new JsonResponse($this->getPortfolioManager()->getUserGuidedPortfoliosData($loggedUser));

        return $response;
    }
137909
public static function get_by_user_id($user_id) {
	$mysql = bootstrap::get_library('mysql');
	
	$sql   = "SELECT * FROM `login_github` WHERE `user_id` = %d;";
	$login = $mysql::select('row', $sql, $user_id);
	if (empty($login)) {
		return false;
	}
	
	return new static($login['id']);
}
834056
public function getUser($userId)
    {
        // Make sure users have been 'got' already.
        $this->getUsers();

        // In most cases by far, we'll request an ID, and we can return it here.
        if ($userId && array_key_exists($userId, $this->users)) {
            return $this->users[$userId];
        }

        // Fallback: See if we can get it by username or email address.
        try {
            if ($userEntity = $this->getRepository()->getUser($userId)) {
                return $userEntity->toArray();
            }
        } catch (TableNotFoundException $e) {
            return false;
        }

        return false;
    }
557283
protected function getUserByToken()
    {
        // Look up in cache and return if found
        if ($user = cache_get('api.userToken', $this->getCacheParams())) {
            return $user;
        }

        // Look up in database
        $user = $this->generateQuery()->first();

        // Add to cache
       if ($user) {
           cache_put('api.userToken', $this->getCacheParams(), $user);
       }

        return $user;
    }
1284545
public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (! is_null($this->user)) {
            return $this->user;
        }

        $user = null;

        // If a user ID was provided in the JWT, then
        // we should attempt to fetch their profile.
        if (! empty($this->id())) {
            $user = $this->provider->retrieveById($this->id());
        }

        return $this->user = $user;
    }