Finds user by [[id]]

@return User|null
492293
public function getUser()
    {
        if ($this->_user === false) {
            foreach (Yii::$app->user->getLoginPriority() as $item) {
                if ($item::validate($this->id)) {
                    return $item::getUser($this->id);
                }
            }
        }

        return $this->_user;
    }
839746
public function find($id)
    {
        return isset($this->rows[$id]) ? $this->instanceRow($this->rows[$id], $this->realRows ? : $this) : null;
    }
1361425
public function findUser($identifier)
    {
        $user = null;
        if($this->isLoaded($identifier))
        {
            if (!is_numeric($identifier)) {
                $user = $this->_emails[$identifier];
            } else {
                $user = parent::findUser($identifier);
            }
        }

        return $user;
    }
802230
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = DpAdminUser::findByUsername($this->username);
        }

        return $this->_user;
    }
718105
public function getUser()
    {
        /** @var TokenInterface $token */
        $token = $this->application['security.token_storage']->getToken();
        if (null === $token) {
            return null;
        }

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

        return $user;
    }
845650
public function getUser()
    {
        // Ensure we have the user info
        if ($this->user === null) {
            $this->exchangeCode();
        }

        if (! is_array($this->user)) {
            return null;
        }

        return $this->user;
    }
1200751
public function findById($id)
	{
		$model = $this->createModel();

		if ( ! $user = $model->newQuery()->find($id))
		{
			throw new UserNotFoundException("A user could not be found with ID [$id].");
		}

		return $user;
	}
1233824
public static function findByUsernameOrEmail($value)
    {
        if ($user = static::findByUsername($value)) {
            return $user;
        }

        if ($user = static::findByEmail($value)) {
            return $user;
        }

        return null;
    }
565440
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = $this->getClient()->user;
        }
        return $this->_user;
    }
808185
function findById(a, id) {
      for (var i = 0; i < a.length; i++) {
        if (a[i].id == id) return a[i];
      }
      return null;
    }
1266850
public static function find_by_user_id($user_id = null)
	{
		if (empty($user_id))
		{
			return false;
		}

		$l = self::blank()->getTableName();
		$d = Domain::blank()->getTableName();

		$results = self::all()
			->select($l . '.*')
			->select($d . '.authenticator', 'auth_domain_name')
			->join($d, $d . '.id', $l . '.auth_domain_id', 'inner')
			->whereEquals($l . '.user_id', $user_id)
			->rows();

		if (empty($results))
		{
			return false;
		}

		return $results->toArray();
	}
830555
public function getUser()
    {
        if (null === $this->getTokenStorage()->getToken()) {
            return null;
        }

        return $this->getTokenStorage()->getToken()->getUser();
    }
1262702
private function findUser($id)
    {
        if (is_array($id)) {
            /** @var User $user */
            $model = User::findIdentities($id);
        } else {
            /** @var User $user */
            $model = User::findIdentity($id);
        }
        if ($model !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('User not found');
        }
    }
736358
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = User::findByUsername($this->username);
        }

        return $this->_user;
    }
382945
public function getUser()
    {
        if ( null === $this->_user && $this->userId )
        {
            $this->_user = $this->getUserMapper()
                                ->find( $this->userId );
        }

        return $this->_user;
    }
242150
public function findUser ($userId) {
    $query = $this->database->pdo->prepare('SELECT username, points FROM users WHERE userId = :userId');
    $query->bindParam(':userId', $userId);

    $query->execute();
    return (object) $query->fetch(PDO::FETCH_ASSOC);
  }
557126
public function getUser() : ?User
    {
        $key = $this->getUserId();

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

        return User::Store()->getById($key);
    }