コード例 #1
0
 /**
  * @View(serializerGroups={"REST"})
  * @param ParamFetcher $paramFetcher
  * @return array
  */
 public function getCustomersAction(ParamFetcher $paramFetcher)
 {
     $restParams = $paramFetcher->All();
     // On récupère tous les paramètres passés en GET
     $em = $this->getDoctrine()->getManager();
     $customerRepo = $em->getRepository('DonateCoreBundle:Customer');
     $customers = $customerRepo->findByRestParams($restParams);
     $nbResults = $customerRepo->countAll();
     return ['nbResults' => $nbResults, 'customers' => $customers];
 }