public function getBasketsAction(ParamFetcherInterface $paramFetcher)
    {
        $orderByQueryParam = new QueryParam();
        $orderByQueryParam->name = 'orderBy';
        $orderByQueryParam->requirements = 'ASC|DESC';
        $orderByQueryParam->nullable = true;
        $orderByQueryParam->strict = true;
        $orderByQueryParam->description = 'Sort specification for the resultset (key is field, value is direction)';

        if (property_exists($orderByQueryParam, 'map')) {
            $orderByQueryParam->map = true;
        } else {
            $orderByQueryParam->array = true;
        }

        $paramFetcher->addParam($orderByQueryParam);

        // No filters implemented as of right now
        $supportedCriteria = [
        ];

        $page = $paramFetcher->get('page');
        $limit = $paramFetcher->get('count');
        $sort = $paramFetcher->get('orderBy');
        $criteria = array_intersect_key($paramFetcher->all(), $supportedCriteria);

        foreach ($criteria as $key => $value) {
            if (null === $value) {
                unset($criteria[$key]);
            }
        }

        if (!$sort) {
            $sort = [];
        } elseif (!\is_array($sort)) {
            $sort = [$sort => 'asc'];
        }

        return $this->basketManager->getPager($criteria, $page, $limit, $sort);
    }
public function getBasketsAction(ParamFetcherInterface $paramFetcher)
    {
        $orderByQueryParam = new QueryParam();
        $orderByQueryParam->name = 'orderBy';
        $orderByQueryParam->requirements = 'ASC|DESC';
        $orderByQueryParam->nullable = true;
        $orderByQueryParam->strict = true;
        $orderByQueryParam->description = 'Sort specification for the resultset (key is field, value is direction)';

        if (property_exists($orderByQueryParam, 'map')) {
            $orderByQueryParam->map = true;
        } else {
            $orderByQueryParam->array = true;
        }

        $paramFetcher->addParam($orderByQueryParam);

        // No filters implemented as of right now
        $supportedCriteria = [
        ];

        $page = $paramFetcher->get('page');
        $limit = $paramFetcher->get('count');
        $sort = $paramFetcher->get('orderBy');
        $criteria = array_intersect_key($paramFetcher->all(), $supportedCriteria);

        foreach ($criteria as $key => $value) {
            if (null === $value) {
                unset($criteria[$key]);
            }
        }

        if (!$sort) {
            $sort = [];
        } elseif (!\is_array($sort)) {
            $sort = [$sort => 'asc'];
        }

        return $this->basketManager->getPager($criteria, $page, $limit, $sort);
    }
public function getBasketsAction ( ParamFetcherInterface $ paramFetcher ) { $ orderByQueryParam = new QueryParam ( ) ; $ orderByQueryParam -> name = 'orderBy' ; $ orderByQueryParam -> requirements = 'ASC|DESC' ; $ orderByQueryParam -> nullable = true ; $ orderByQueryParam -> strict = true ; $ orderByQueryParam -> description = 'Sort specification for the resultset (key is field, value is direction)' ; if ( property_exists ( $ orderByQueryParam , 'map' ) ) { $ orderByQueryParam -> map = true ; } else { $ orderByQueryParam -> array = true ; } $ paramFetcher -> addParam ( $ orderByQueryParam ) ; // No filters implemented as of right now $ supportedCriteria = [ ] ; $ page = $ paramFetcher -> get ( 'page' ) ; $ limit = $ paramFetcher -> get ( 'count' ) ; $ sort = $ paramFetcher -> get ( 'orderBy' ) ; $ criteria = array_intersect_key ( $ paramFetcher -> all ( ) , $ supportedCriteria ) ; foreach ( $ criteria as $ key => $ value ) { if ( null === $ value ) { unset ( $ criteria [ $ key ] ) ; } } if ( ! $ sort ) { $ sort = [ ] ; } elseif ( ! \ is_array ( $ sort ) ) { $ sort = [ $ sort => 'asc' ] ; } return $ this -> basketManager -> getPager ( $ criteria , $ page , $ limit , $ sort ) ; }
Returns a paginated list of baskets.

@ApiDoc(
resource=true,
output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}}
)

@QueryParam(name="page", requirements="\d+", default="1", description="Page for baskets list pagination (1-indexed)")
@QueryParam(name="count", requirements="\d+", default="10", description="Number of baskets by page")

@View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)

@param ParamFetcherInterface $paramFetcher

@return Sonata\DatagridBundle\Pager\PagerInterface[]
Returns a paginated list of baskets .