src/Repository/ItemRepository.php
public function findByIds(array $ids): array
    {
        $result = [];
        if (count($ids) > 0) {
            $queryBuilder = $this->entityManager->createQueryBuilder();
            $queryBuilder->select('i')
                         ->from(Item::class, 'i')
                         ->andWhere('i.id IN (:ids)')
                         ->setParameter('ids', array_values($ids));

            $result = $queryBuilder->getQuery()->getResult();
        }
        return $result;
    }
public function findByIds(array $ids): array
    {
        $result = [];
        if (count($ids) > 0) {
            $queryBuilder = $this->entityManager->createQueryBuilder();
            $queryBuilder->select('i')
                         ->from(Item::class, 'i')
                         ->andWhere('i.id IN (:ids)')
                         ->setParameter('ids', array_values($ids));

            $result = $queryBuilder->getQuery()->getResult();
        }
        return $result;
    }
public function findByIds ( array $ ids ) : array { $ result = [ ] ; if ( count ( $ ids ) > 0 ) { $ queryBuilder = $ this -> entityManager -> createQueryBuilder ( ) ; $ queryBuilder -> select ( 'i' ) -> from ( Item :: class , 'i' ) -> andWhere ( 'i.id IN (:ids)' ) -> setParameter ( 'ids' , array_values ( $ ids ) ) ; $ result = $ queryBuilder -> getQuery ( ) -> getResult ( ) ; } return $ result ; }
Finds the items with the specified ids.
@param array|int[] $ids
@return array|Item[]
Finds the items with the specified ids .