bridge/doctrine-orm/lib/OrmAgent.php
public function findMany(array $identifiers, string $class = null)
    {
        if (null === $class) {
            throw BadMethodCallException::classArgumentIsMandatory(__CLASS__);
        }

        $classMetadata = $this->entityManager->getMetadataFactory()->getMetadataFor($class);

        $idFields = $classMetadata->getIdentifier();

        if (count($idFields) > 1) {
            throw new \RuntimeException(sprintf(
                'Only objects with a single primary key are supported. Class: "%s", primary key fields: "%s"',
                $class, implode('", "', $idFields)
            ));
        }

        $idField = reset($idFields);

        $queryBuilder = $this->entityManager->getRepository($class)->createQueryBuilder('a');
        $queryBuilder->where($queryBuilder->expr()->in('a.' . $idField, ':identifiers'));
        $queryBuilder->setParameter('identifiers', $identifiers);

        return $queryBuilder->getQuery()->execute();
    }
public function findMany(array $identifiers, string $class = null)
    {
        if (null === $class) {
            throw BadMethodCallException::classArgumentIsMandatory(__CLASS__);
        }

        $classMetadata = $this->entityManager->getMetadataFactory()->getMetadataFor($class);

        $idFields = $classMetadata->getIdentifier();

        if (count($idFields) > 1) {
            throw new \RuntimeException(sprintf(
                'Only objects with a single primary key are supported. Class: "%s", primary key fields: "%s"',
                $class, implode('", "', $idFields)
            ));
        }

        $idField = reset($idFields);

        $queryBuilder = $this->entityManager->getRepository($class)->createQueryBuilder('a');
        $queryBuilder->where($queryBuilder->expr()->in('a.' . $idField, ':identifiers'));
        $queryBuilder->setParameter('identifiers', $identifiers);

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