Connector/IdentityService/Storage/DatabaseIdentityServiceStorage.php
public function findBy(array $criteria = [])
    {
        $queryBuilder = $this->connection->createQueryBuilder();
        $queryBuilder->from($this->table, 'identity');
        $queryBuilder->select([
            'identity.objectIdentifier',
            'identity.objectType',
            'identity.adapterIdentifier',
            'identity.adapterName',
        ]);

        foreach ($criteria as $key => $value) {
            $queryBuilder->andWhere($queryBuilder->expr()->eq($key, ':' . $key));
            $queryBuilder->setParameter(':' . $key, $value);
        }

        $result = $queryBuilder->execute()->fetchAll();

        return array_map(function (array $result) {
            return Identity::fromArray([
                'objectIdentifier' => $result['objectIdentifier'],
                'objectType' => $result['objectType'],
                'adapterIdentifier' => $result['adapterIdentifier'],
                'adapterName' => $result['adapterName'],
            ]);
        }, $result);
    }
public function findBy(array $criteria = [])
    {
        $queryBuilder = $this->connection->createQueryBuilder();
        $queryBuilder->from($this->table, 'identity');
        $queryBuilder->select([
            'identity.objectIdentifier',
            'identity.objectType',
            'identity.adapterIdentifier',
            'identity.adapterName',
        ]);

        foreach ($criteria as $key => $value) {
            $queryBuilder->andWhere($queryBuilder->expr()->eq($key, ':' . $key));
            $queryBuilder->setParameter(':' . $key, $value);
        }

        $result = $queryBuilder->execute()->fetchAll();

        return array_map(function (array $result) {
            return Identity::fromArray([
                'objectIdentifier' => $result['objectIdentifier'],
                'objectType' => $result['objectType'],
                'adapterIdentifier' => $result['adapterIdentifier'],
                'adapterName' => $result['adapterName'],
            ]);
        }, $result);
    }
public function findBy ( array $ criteria = [ ] ) { $ queryBuilder = $ this -> connection -> createQueryBuilder ( ) ; $ queryBuilder -> from ( $ this -> table , 'identity' ) ; $ queryBuilder -> select ( [ 'identity.objectIdentifier' , 'identity.objectType' , 'identity.adapterIdentifier' , 'identity.adapterName' , ] ) ; foreach ( $ criteria as $ key => $ value ) { $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> eq ( $ key , ':' . $ key ) ) ; $ queryBuilder -> setParameter ( ':' . $ key , $ value ) ; } $ result = $ queryBuilder -> execute ( ) -> fetchAll ( ) ; return array_map ( function ( array $ result ) { return Identity :: fromArray ( [ 'objectIdentifier' => $ result [ 'objectIdentifier' ] , 'objectType' => $ result [ 'objectType' ] , 'adapterIdentifier' => $ result [ 'adapterIdentifier' ] , 'adapterName' => $ result [ 'adapterName' ] , ] ) ; } , $ result ) ; }
{@inheritdoc}
{