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