public function getMyPaymentsNgAction(Request $request) { $em = $this->getDoctrine()->getManager(); $response = new Response(json_encode(array("result" => Payment::getUserPayments($em, $this->getUser()->getId(), $request->query->all(), true)))); $response->headers->set('Content-Type', 'application/json'); return $response; }