public function cgetAction(ParamFetcherInterface $paramFetcher)
    {
        try {
            $offset = $paramFetcher->get('offset');
            $limit = $paramFetcher->get('limit');
            $order_by = $paramFetcher->get('order_by');
            $filters = !is_null($paramFetcher->get('filters')) ? $paramFetcher->get('filters') : array();

            $em = $this->getDoctrine()->getManager();
            $entities = $em->getRepository($this->entityClassName())
                ->findBy($filters, $order_by, $limit, $offset);

            if ($entities) {
                return $entities;
            }

            return FOSView::create('Not Found', Response::HTTP_NO_CONTENT);
        } catch (\Exception $e) {
            return FOSView::create($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);
        }
    }
public function cgetAction(ParamFetcherInterface $paramFetcher)
    {
        try {
            $offset = $paramFetcher->get('offset');
            $limit = $paramFetcher->get('limit');
            $order_by = $paramFetcher->get('order_by');
            $filters = !is_null($paramFetcher->get('filters')) ? $paramFetcher->get('filters') : array();

            $em = $this->getDoctrine()->getManager();
            $entities = $em->getRepository($this->entityClassName())
                ->findBy($filters, $order_by, $limit, $offset);

            if ($entities) {
                return $entities;
            }

            return FOSView::create('Not Found', Response::HTTP_NO_CONTENT);
        } catch (\Exception $e) {
            return FOSView::create($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);
        }
    }
public function cgetAction ( ParamFetcherInterface $ paramFetcher ) { try { $ offset = $ paramFetcher -> get ( 'offset' ) ; $ limit = $ paramFetcher -> get ( 'limit' ) ; $ order_by = $ paramFetcher -> get ( 'order_by' ) ; $ filters = ! is_null ( $ paramFetcher -> get ( 'filters' ) ) ? $ paramFetcher -> get ( 'filters' ) : array ( ) ; $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ entities = $ em -> getRepository ( $ this -> entityClassName ( ) ) -> findBy ( $ filters , $ order_by , $ limit , $ offset ) ; if ( $ entities ) { return $ entities ; } return FOSView :: create ( 'Not Found' , Response :: HTTP_NO_CONTENT ) ; } catch ( \ Exception $ e ) { return FOSView :: create ( $ e -> getMessage ( ) , Response :: HTTP_INTERNAL_SERVER_ERROR ) ; } }
Get all Product entities.

@ApiDoc

@View(serializerEnableMaxDepthChecks=true)

@param ParamFetcherInterface $paramFetcher

@return array|FOSView

@QueryParam(name="offset", requirements="\d+", nullable=true, description="Offset from which to start listing notes.")
@QueryParam(name="limit", requirements="\d+", default="20", description="How many notes to return.")
@QueryParam(name="order_by", nullable=true, map=true, description="Order by fields. Must be an array ie. &order_by[name]=ASC&order_by[description]=DESC")
@QueryParam(name="filters", nullable=true, map=true, description="Filter by fields. Must be an array ie. &filters[id]=3")
Get all Product entities .