@param Identity $identity

@return MysqlAbstract
960833
protected function _fetchAll(Identity $identity)
    {
        $this->_rawData = $this->_db->fetchAll($this->_getSelectWithLimit($identity));
        return $this;
    }
738076
public function byIdentity($identity = null)
    {
        if (!$identity) {
            $identity = Yii::$app->user->identity;
        }
        if (method_exists($identity, 'canGetProperty') && !$identity->canGetProperty('guid')) {
            return $this;
        }
        return $this->createdBy($identity->getGUID());
    }
381456
protected function _createPlainToken($identity)
    {
        $usernameField = $this->getConfig('fields.username');
        $passwordField = $this->getConfig('fields.password');

        return $identity[$usernameField] . $identity[$passwordField];
    }
931031
function setIdentity(NS\IIdentity $identity = null)
       {
           if(isset($identity))
           {
                $data = serialize($identity);
                $this->container->get('session')->set('identity',$data);
           
            
          
           }
  
         
       }
936164
public function setIdentity($identity = null)
    {
        if (null === $identity) {
            // Setting the identity to null resets the code and messages.
            $this->setCode();
            $this->setMessages();
        }
        $this->setParam('identity', $identity);
        return $this;
    }
602499
protected function _getSelectWithLimit(Identity $identity)
    {
        $sf = $this->_getSelectionFactory();

        return $this->_getSelect($identity)->limit($sf->limit($identity), $sf->offset($identity));
    }
927634
public function setIdentity(IIdentity $identity = NULL)
	{
		if ($identity !== NULL) {
			$class = get_class($identity);

			// we want to convert identity entities into fake identity
			// so only the identifier fields are stored,
			// but we are only interested in identities which are correctly
			// mapped as doctrine entities
			if ($this->entityManager->getMetadataFactory()->hasMetadataFor($class)) {
				$cm = $this->entityManager->getClassMetadata($class);
				$identifier = $cm->getIdentifierValues($identity);
				$identity = new FakeIdentity($identifier, $class);
			}
		}

		return parent::setIdentity($identity);
	}
496430
public function detach(Identity $identity): self
    {
        $this->states = $this->states->map(static function(
            State $state,
            MapInterface $entities
        ) use (
            $identity
        ) {
            return $entities->remove($identity);
        });

        return $this;
    }
259898
public function equals(ObjectIdentifiableInterface $identity)
    {
        return ($this->getType() === $identity->getType() && $this->getIdentifier() === $identity->getIdentifier());
    }
564809
public function findUser($identity, $credential)
    {
        $this->connection->connect();
        $stmt = $this->connection->prepare(
            "SELECT * FROM \"{$this->tableName}\" WHERE \"{$this->identityColumn}\" = :username " . $this->conditions
        );

        $stmt->execute([':username' => $identity]);
        $result = $stmt->fetch(PDO::FETCH_ASSOC);

        if ($result !== false || $stmt->rowCount() === 0) {
            if (!empty($result)) {
                if (isset($result[$this->credentialColumn])) {
                    if ($this->passwordCrypt->verify($credential, $result[$this->credentialColumn]) === true) {
                        return $result;
                    }

                    throw new CredentialInvalidException;
                }

                throw new Exception(sprintf('Column "%s" does not exists.', $this->credentialColumn));
            }

            throw new IdentityNotFoundException;
        }

        throw new Exception($stmt->errorInfo()[2], $stmt->errorInfo()[1]);
    }
654178
public function create($identity, $service, $total_allowance = false, $analyze_queries = false)
    {

        $params = array(
            'service' => $service,
        );

        if ($total_allowance) {
            $params['total_allowance'] = $total_allowance;
        }
        if ($analyze_queries) {
            $params['analyze_queries'] = $analyze_queries;
        }

        return $this->_user->post('account/identity/' . $identity . '/limit', $params);
    }
1269934
public function findIdentityById(int $identityId): Entity\Identity
    {
        $identity = new Entity\Identity;
        $identity->setId($identityId);

        $this->repository->load($identity, Entity\Identity::class);

        if ($identity->getAccountId() === null) {
            $this->logger->notice('identity not found', [
                'input' => [
                    'id' => $identityId,
                ],
            ]);

            throw new IdentityNotFound;
        }

        return $identity;
    }
414712
public function use(Identity $identity, MapInterface $source): self
    {
        if (
            (string) $source->keyType() !== 'string' ||
            (string) $source->valueType() !== 'mixed'
        ) {
            throw new \TypeError('Argument 2 must be of type MapInterface<string, mixed>');
        }

        $this->sources = $this->sources->put($identity, $source);

        return $this;
    }
897843
public function setIdentity(IdentityInterface $identity): void
    {
        // save identity to Auth
        $this->identity = $identity;
        // regenerate session
        if (PHP_SAPI !== 'cli') {
            Session::regenerateId();
        }
        // save identity to session
        Session::set('auth:identity', $identity);
        // save user agent to session
        Session::set('auth:agent', Request::getServer('HTTP_USER_AGENT'));
    }
263412
public function update($identity, $service, $token)
    {

        $params = array(
            'token' => $token,
        );

        return $this->_user->put('account/identity/' . $identity . '/token/' . $service, $params);
    }
777642
private function matchAggregate(
        Identity $identity,
        object $entity,
        Aggregate $meta,
        MapInterface $changeset,
        Query $query
    ): Query {
        $name = $this->name->sprintf(\md5($identity->value()));
        $query = $query
            ->match(
                (string) $name,
                $meta->labels()->toPrimitive()
            )
            ->withProperty(
                $meta->identity()->property(),
                (string) $name
                    ->prepend('{')
                    ->append('_identity}')
            )
            ->withParameter(
                (string) $name->append('_identity'),
                $identity->value()
            );
        $this->variables = $this->variables->put(
            $name,
            $this->buildProperties(
                $changeset,
                $meta->properties()
            )
        );

        return $meta
            ->children()
            ->filter(static function(string $property) use ($changeset): bool {
                return $changeset->contains($property);
            })
            ->reduce(
                $query,
                function(Query $carry, string $property, Child $child) use ($changeset, $name): Query {
                    $changeset = $changeset->get($property);
                    $childName = null;
                    $relName = $name
                        ->append('_')
                        ->append($property);
                    $this->variables = $this->variables->put(
                        $relName,
                        $this->buildProperties(
                            $changeset,
                            $child->relationship()->properties()
                        )
                    );

                    if ($changeset->contains($child->relationship()->childProperty())) {
                        $childName = $relName
                            ->append('_')
                            ->append(
                                $child->relationship()->childProperty()
                            );
                        $this->variables = $this->variables->put(
                            $childName,
                            $changeset->get(
                                $child->relationship()->childProperty()
                            )
                        );
                    }

                    return $carry
                        ->match((string) $name)
                        ->linkedTo(
                            $childName ? (string) $childName : null,
                            $child->labels()->toPrimitive()
                        )
                        ->through(
                            (string) $child->relationship()->type(),
                            (string) $relName
                        );
                }
            );
    }
930494
public function buildIdentity($identityData)
    {
        $class = $this->getConfig('identityClass');

        if (is_callable($class)) {
            $identity = $class($identityData);
        } else {
            $identity = new $class($identityData);
        }

        if (!($identity instanceof IdentityInterface)) {
            throw new RuntimeException(sprintf(
                'Object `%s` does not implement `%s`',
                get_class($identity),
                IdentityInterface::class
            ));
        }

        return $identity;
    }