public function deleteTodosAction($id)
{
$todo = $this->getDoctrine()->getRepository('AcmeDemoBundle:Todo')->find($id);
if (!$todo) {
throw $this->createNotFoundException("Todo does not exist.");
}
$em = $this->getDoctrine()->getManager();
$em->remove($todo);
$em->flush();
return $this->handleView($this->routeRedirectView('get_todos', [], Codes::HTTP_NO_CONTENT));
}