Model/Carousel/Repository.php
public function findLimited($limit = 0)
    {
        $queryBuilder = $this->createQueryBuilder('c')
            ->where('c.enabled = :enabled')
            ->orderBy('c.position')
            ->setParameters(array(
                'enabled' => true,
            ));

        if ($limit != 0) {
            $queryBuilder->setMaxResults($limit);
        }

        return $queryBuilder->getQuery()->getResult();
    }
public function findLimited($limit = 0)
    {
        $queryBuilder = $this->createQueryBuilder('c')
            ->where('c.enabled = :enabled')
            ->orderBy('c.position')
            ->setParameters(array(
                'enabled' => true,
            ));

        if ($limit != 0) {
            $queryBuilder->setMaxResults($limit);
        }

        return $queryBuilder->getQuery()->getResult();
    }
public function findLimited ( $ limit = 0 ) { $ queryBuilder = $ this -> createQueryBuilder ( 'c' ) -> where ( 'c.enabled = :enabled' ) -> orderBy ( 'c.position' ) -> setParameters ( array ( 'enabled' => true , ) ) ; if ( $ limit != 0 ) { $ queryBuilder -> setMaxResults ( $ limit ) ; } return $ queryBuilder -> getQuery ( ) -> getResult ( ) ; }
Return a list of carousel items

@param  integer $limit
@return ArrayCollection
Return a list of carousel items