Returns a UserMetadata Object for a given card, containing the properties and settings for that card.
@param  string $id The card ID
@return UserMetadata
763623
private function loadCardDetailsModel($id=NULL)
	{
		if ($id == NULL)
			throw new CHttpException(400, Yii::t('Api.card', 'Missing card ID'));

		$model = UserMetadata::model()->getPrototype('UserMetadata', array(
		             'user_id' => $this->user->id,
		             'key' => $id.'_card_settings'
		         ), array('value' => '{}'));

		$model->value = CJSON::decode($model->value);

		return $model;
	}
536233
protected function getUser($id)
    {
        $class = Yii::$app->user->identityClass;
        if (!class_exists($class)) {
            return null;
        }
        $user = $class::find()->id($id)->one();
        if (empty($user) || !($user instanceof User)) {
            throw new BadRequestHttpException(Yii::t('user', 'User Not Found.'));
        }
        return $user;
    }
273111
public function onceUsingId($id)
    {
        $this->setUser($this->provider->retrieveById($id));

        return $this->user instanceof UserContract;
    }
1045585
public function get($id): QueryEntity
    {
        if ($this->has($id)) {
            return $this->meta[$id];
        }

        throw new RuntimeException("Meta with name \"{$id}\" does not exists.");
    }
815401
public function getUser(string $id): User
    {
        @trigger_error(sprintf('The %s() method is deprecated since version 0.8. Use get() instead.', __METHOD__), E_USER_DEPRECATED);

        return $this->get($id);
    }
659471
public function getUser($id = 0)
    {
        $auth = false;

        if ($id === 0 && isset($this->_accesstoken)) {
            $id = 'self';
            $auth = true;
        }

        return $this->_makeCall('users/' . $id, $auth);
    }
821807
public function read($id)
	{
        $this->_data = '';

        if ($id === '') {
            return $this->_data;
        }

        if ($session = $this->_getSession($id)) {
            $this->_data = (string) $session->meta;
        }

		return $this->_data;
	}
73642
protected function _loadMetadatas($id)
    {
        $file = $this->_metadatasFile($id);
        $result = $this->_fileGetContents($file);
        if (!$result) {
            return false;
        }
        $tmp = @unserialize($result);
        return $tmp;
    }
1184275
public function loggedUser($id)
    {
        if (Podium::getInstance()->userComponent !== true) {
            return $this->andWhere(['inherited_id' => $id]);
        }
        return $this->andWhere(['id' => $id]);
    }
409625
protected function getRawConfig(/*# string */ $id)
    {
        $this->config_resolver->enableDeReference(false);
        $data = $this->config_resolver->get($id);
        $this->config_resolver->enableDeReference(true);
        return $data;
    }
436164
public function prepareUser($id)
    {
        $userClass = config('auth.providers.users.model');

        if (! class_exists($userClass)) {
            throw new Exception("User class {$userClass} not found.");
        }

        if(! $user = $userClass::whereId($id)->first()) {
            throw new Exception("User by ID {$id} not found.");
        }

        return $user;
    }
49665
public function get($id)
    {
        if (!$this->isAllowed(RcmUserAclResourceProvider::RESOURCE_ID_ACL, 'read')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $rcmUserService = $this->getRcmUserService();

        $requestUser = $rcmUserService->buildNewUser();

        $requestUser->setId($id);

        $userResult = $rcmUserService->readUser($requestUser);

        if (!$userResult->isSuccess()) {
            return new ApiJsonModel(
                null,
                1,
                "User was not found with id {$id}."
            );
        }

        $user = $userResult->getUser();

        $resourceId = $this->getRequestResourceId();
        $privileges = $this->getRequestPrivileges();

        $apiResponse = [
            'hasAccess' => $rcmUserService->isUserAllowed(
                $resourceId,
                $privileges,
                null,
                $user
            ),
            'resourceId' => $resourceId,
            'privileges' => $privileges,
            // 'user' => $user,
            'userRoles' => $user->getProperty(UserRoleProperty::PROPERTY_KEY)
        ];

        return new ApiJsonModel($apiResponse, 0, 'Success');
    }
379781
public function findMeta($id, $key)
    {
        $meta = $this->getMeta($id);

        if (is_string($result = $meta->get($key))) {
            return $result;
        }

        return new Collection($result);
    }
1040282
public function getInstance($id = null)
	{
		$current = $this->getCurrentUser();

		// Does the ID match to the current user?
		// If so, we already have that info and can just return it
		if (is_null($id))
		{
			return $current;
		}

		if (is_numeric($id))
		{
			// Cast as an integer so we can do an exact (===) comparison below
			$id = (int)$id;
		}

		if ($id === (int)$current->get('id')
		 || $id === (string)$current->get('username'))
		{
			return $current;
		}

		// Is the ID numeric?
		// If not, let's try to resolve by username or email address.
		if (!is_numeric($id))
		{
			$user = $this->resolveUser($id);
			$id   = $user->get('id', 0);

			if ($id)
			{
				$this->users[$id] = $user;
			}
		}

		// If the $id is zero, just return an empty User.
		// Note: don't cache this user because it'll have a new ID on save!
		if ($id === 0)
		{
			return new User;
		}

		// If the given user has not been created before, we will create the instance
		// here and cache it so we can return it next time very quickly. If there is
		// already a user created for this ID, we'll just return that instance.
		if (!isset($this->users[$id]))
		{
			$this->users[$id] = $this->resolveUser($id);
		}

		return $this->users[$id];
	}
462136
protected function getUser($id)
    {
        $user = $this->userManager->findUserBy(['id' => $id]);

        if (null === $user) {
            throw new NotFoundHttpException(sprintf('User (%d) not found', $id));
        }

        return $user;
    }
1116075
protected function _delMetadatas($id)
    {
        if (isset($this->_metadatasArray[$id])) {
            unset($this->_metadatasArray[$id]);
        }
        $file = $this->_metadatasFile($id);
        return $this->_remove($file);
    }
290186
public function getMeta($id, $name = null, $field = 'value') {
        if ($name) {
            $values = $this->get([$this->metaIdField => intval($id), $this->metaNameField => $name])->get($field);
        } else {
            $values = $this->findAll([$this->metaIdField => intval($id)], [
                $field,
                $this->metaNameField
            ])->toArray($field, $this->metaNameField);
        }

        return $values;
    }