@param Identity $identity

@return \G4\DataMapper\Collection\CollectionAbstract
490836
public function findAll(Identity $identity = null)
    {
        if ($identity === null) {
            $identity = $this->getIdentity();
        }

        return $this
            ->_fetchAll($identity)
            ->_fetchCount($identity)
            ->_returnCollection();
    }
114137
protected static function _findUserByIdentity($identity)
    {
        return (new CmsAuthQuery)
            ->whereActive()->equals(true)
            ->andQuery((new CmsAuthQuery)
                ->whereUsername()->equals($identity)
                ->orFieldEmail()->equals($identity)
                ->orFieldId()->equals((integer)$identity))
            ->findFirst();
    }
724022
public function deleteIdentity($identity)
    {
        $this->_action = 'DeleteIdentity';
        $this->_method = 'GET';
        $this->_refreshDate();

        if (!(filter_var($identity, FILTER_VALIDATE_EMAIL) || preg_match('/^([a-z\d]+(-[a-z\d]+)*\.)+[a-z]{2,}$/', $identity))) {
            throw new Exception('Identity must be EmailAddress or Domain');
            return;
        }

        $parameters = array(
            'Identity' => $identity
        );

        $this->_generateSignature($parameters);
        $res = $this->_request();
        if ($res['code'] == 200) {
            return (string) $res['body']->ResponseMetadata->RequestId;
        } else {
            return new SimpleEmailServiceError((string) $res['body']->Error->Code);
        }
    }
750057
private function findAccessToken(array $identity)
    {
        $config = $this->container->get('config');

        foreach ($config['zf-oauth2-doctrine'] as $oauth2Config) {
            if (array_key_exists('object_manager', $oauth2Config)) {
                $objectManager = $this->container->get($oauth2Config['object_manager']);
                $accessTokenRepository = $objectManager
                    ->getRepository($oauth2Config['mapping']['AccessToken']['entity']);

                $accessToken = $accessTokenRepository->findOneBy([
                    $oauth2Config['mapping']['AccessToken']['mapping']['access_token']['name']
                    => array_key_exists('access_token', $identity) ? $identity['access_token'] : $identity['id'],
                ]);

                if ($accessToken) {
                    if ($accessToken->getClient()->getClientId() == $identity['client_id']) {
                        // Match found
                        return $accessToken;
                    }
                }
            }
        }
    }
1207323
public function get(string $class, string $identity)
    {
        if (!$this->has($class, $identity)) {
            return null;
        }

        return $this->entities["{$class}:{$identity}"];
    }
5411
private function createAggregate(
        Identity $identity,
        object $entity,
        Query $query
    ): Query {
        $meta = ($this->metadata)(\get_class($entity));
        $data = ($this->extract)($entity);
        $varName = $this->name->sprintf(\md5($identity->value()));

        $query = $query->create(
            (string) $varName,
            $meta->labels()->toPrimitive()
        );
        $paramKey = $varName->append('_props');
        $properties = $this->buildProperties(
            $meta->properties(),
            $paramKey
        );
        $keysToKeep = $data->keys()->intersect($properties->keys());

        $query = $query
            ->withProperty(
                $meta->identity()->property(),
                (string) $paramKey
                    ->prepend('{')
                    ->append('}.')
                    ->append($meta->identity()->property())
            )
            ->withProperties($properties->reduce(
                [],
                static function(array $carry, string $property, string $cypher): array {
                    $carry[$property] = $cypher;

                    return $carry;
                }
            ))
            ->withParameter(
                (string) $paramKey,
                $data
                    ->filter(static function(string $key) use ($keysToKeep): bool {
                        return $keysToKeep->contains($key);
                    })
                    ->put(
                        $meta->identity()->property(),
                        $identity->value()
                    )
                    ->reduce(
                        [],
                        static function(array $carry, string $key, $value): array {
                            $carry[$key] = $value;

                            return $carry;
                        }
                    )
            );

        $query = $meta
            ->children()
            ->reduce(
                $query,
                function(Query $carry, string $property, Child $child) use ($varName, $data): Query {
                    return $this->createAggregateChild(
                        $child,
                        $varName,
                        $data->get($property),
                        $carry
                    );
                }
            );
        $this->variables = $this->variables->add((string) $varName);

        return $query;
    }
187734
public function getById($identity) {
        $path = $this->path . "/" . $identity;
        return $this->openSearchClient->get($path);
    }
1316649
public function setIdentity($identity)
    {
        $identity = (string) $identity;
        if ($identity === '') {
            throw new \InvalidArgumentException('$identity cannot be empty');
        }

        $this->identity = $identity;

        return $this;
    }
248940
public function find($identity)
    {
        if( !$this->primaryKey ) {
            throw new LogicException('No primary key!');
        }
        return $this->select()
                ->where($this->primaryKey, $identity)
                ->limit(1)
                ->query()
                ->fetchRow();
    }
381456
protected function _createPlainToken($identity)
    {
        $usernameField = $this->getConfig('fields.username');
        $passwordField = $this->getConfig('fields.password');

        return $identity[$usernameField] . $identity[$passwordField];
    }
1058495
public function getContext($identity) {
        return new SyncMapPermissionContext(
            $this->version,
            $this->solution['serviceSid'],
            $this->solution['mapSid'],
            $identity
        );
    }
505161
public function removeById($identity) {
        $path = $this->path . "/" . $identity;
        return $this->openSearchClient->delete($path);
    }
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;
    }
259898
public function equals(ObjectIdentifiableInterface $identity)
    {
        return ($this->getType() === $identity->getType() && $this->getIdentifier() === $identity->getIdentifier());
    }
361444
public function getAllowed($identity)
	{
		// Sweep for the allowed actions.
		$allowed = new Obj;

		foreach ($this->data as $name => &$action)
		{
			if ($action->allow($identity))
			{
				$allowed->set($name, true);
			}
		}

		return $allowed;
	}
923588
public function getById($id)
    {
        $image = $this->adapter->get(sprintf('%s/images/%d', $this->endpoint, $id));

        $image = json_decode($image);

        return new ImageEntity($image->image);
    }
117222
public function get(Identity $identity): object
    {
        return $this
            ->states
            ->get($this->stateFor($identity))
            ->get($identity);
    }