rendered paste body $form = $this->createForm(new Form\RouteType(), new Entity\Route()); if ($request->getMethod() == 'POST') { $form->bindRequest($request); $user = $this->get('security.context')->getToken()->getUser(); $form->getData()->setCarrier($user); if ($form->isValid()) { echo $form->getData()->getDepartureStationId(); $em = $this->getDoctrine()->getEntityManager(); $em->persist($form->getData()); $em->flush(); $this->get('session')->setFlash('_success', 'Маршрут успешно добавлен'); return $this->redirect($this->generateUrl('CarrierOTPBundle_admin_route_list')); } }