public function findAll($page = 1, $max = 50)
    {
        $offset = (($page - 1) * $max);
        $products = $this->getEm()->getRepository("AmulenShopBundle:Product")->findBy(array(), array(), $max, $offset);
        return $products;
    }
public function findAll($page = 1, $max = 50)
    {
        $offset = (($page - 1) * $max);
        $products = $this->getEm()->getRepository("AmulenShopBundle:Product")->findBy(array(), array(), $max, $offset);
        return $products;
    }
public function findAll ( $ page = 1 , $ max = 50 ) { $ offset = ( ( $ page - 1 ) * $ max ) ; $ products = $ this -> getEm ( ) -> getRepository ( "AmulenShopBundle:Product" ) -> findBy ( array ( ) , array ( ) , $ max , $ offset ) ; return $ products ; }
Find al Products with pagination options.
@param  integer $page [description]
@param  integer $max [description]
@return ArrayCollection        Products.
Find al Products with pagination options .