public function findByIds($ids)
    {
        if (!is_array($ids)) {
            $ids = explode(',', $ids);
        }

        if (!$ids) {
            return [];
        }

        return $this->createValuedQueryBuilder('c')
            ->andWhere('c.id IN (:ids)')->setParameter('ids', $ids)
            ->andWhere('c.deletedAt IS NULL')
            ->andWhere('c.active = :active')
            ->andWhere('c.layout = :layout')
            ->andWhere('c.publishAt < :now OR c.publishAt IS NULL')->setParameter('now', new \DateTime())
            ->setParameter('active', true)
            ->setParameter('layout', false)
            ->getQuery()
            ->useResultCache(true, self::CACHE_TTL)
            ->getResult();
    }
public function findByIds($ids)
    {
        if (!is_array($ids)) {
            $ids = explode(',', $ids);
        }

        if (!$ids) {
            return [];
        }

        return $this->createValuedQueryBuilder('c')
            ->andWhere('c.id IN (:ids)')->setParameter('ids', $ids)
            ->andWhere('c.deletedAt IS NULL')
            ->andWhere('c.active = :active')
            ->andWhere('c.layout = :layout')
            ->andWhere('c.publishAt < :now OR c.publishAt IS NULL')->setParameter('now', new \DateTime())
            ->setParameter('active', true)
            ->setParameter('layout', false)
            ->getQuery()
            ->useResultCache(true, self::CACHE_TTL)
            ->getResult();
    }
public function findByIds ( $ ids ) { if ( ! is_array ( $ ids ) ) { $ ids = explode ( ',' , $ ids ) ; } if ( ! $ ids ) { return [ ] ; } return $ this -> createValuedQueryBuilder ( 'c' ) -> andWhere ( 'c.id IN (:ids)' ) -> setParameter ( 'ids' , $ ids ) -> andWhere ( 'c.deletedAt IS NULL' ) -> andWhere ( 'c.active = :active' ) -> andWhere ( 'c.layout = :layout' ) -> andWhere ( 'c.publishAt < :now OR c.publishAt IS NULL' ) -> setParameter ( 'now' , new \ DateTime ( ) ) -> setParameter ( 'active' , true ) -> setParameter ( 'layout' , false ) -> getQuery ( ) -> useResultCache ( true , self :: CACHE_TTL ) -> getResult ( ) ; }
Find content items by multiple ids.

@param array $ids

@return Content[]
Find content items by multiple ids .