public function finishTaskNgAction($task_id) { $em = $this->getDoctrine()->getManager(); $task = Task::finishTaskById($em, $task_id); $response = new Response(json_encode(array("result" => $task->getInArray()))); $response->headers->set('Content-Type', 'application/json'); return $response; }