bridge/doctrine-phpcr-odm/lib/PhpcrOdmAgent.php
public function query(Query $query): \Traversable
    {
        $sourceAlias = 'a';
        $queryBuilder = $this->documentManager->getRepository($query->getClassFqn())->createQueryBuilder($sourceAlias);

        if ($query->hasExpression()) {
            $visitor = new ExpressionVisitor(
                $queryBuilder,
                $sourceAlias
            );

            $visitor->dispatch($query->getExpression());
        }

        $orderBy = $queryBuilder->orderBy();
        foreach ($query->getOrderings() as $field => $order) {
            $order = strtolower($order);
            $orderBy->{$order}()->field($sourceAlias . '.' .  $field);
        }

        if (null !== $query->getFirstResult()) {
            $queryBuilder->setFirstResult($query->getFirstResult());
        }

        if (null !== $query->getMaxResults()) {
            $queryBuilder->setMaxResults($query->getMaxResults());
        }

        return $queryBuilder->getQuery()->execute();
    }
public function query(Query $query): \Traversable
    {
        $sourceAlias = 'a';
        $queryBuilder = $this->documentManager->getRepository($query->getClassFqn())->createQueryBuilder($sourceAlias);

        if ($query->hasExpression()) {
            $visitor = new ExpressionVisitor(
                $queryBuilder,
                $sourceAlias
            );

            $visitor->dispatch($query->getExpression());
        }

        $orderBy = $queryBuilder->orderBy();
        foreach ($query->getOrderings() as $field => $order) {
            $order = strtolower($order);
            $orderBy->{$order}()->field($sourceAlias . '.' .  $field);
        }

        if (null !== $query->getFirstResult()) {
            $queryBuilder->setFirstResult($query->getFirstResult());
        }

        if (null !== $query->getMaxResults()) {
            $queryBuilder->setMaxResults($query->getMaxResults());
        }

        return $queryBuilder->getQuery()->execute();
    }
{@inheritdoc}