public function newAction(Request $request) { $entity = new Cita(); $FosUser = new FosUser(); if ($request->getMethod() == 'POST') { $em = $this->getDoctrine()->getManager(); $id = $this->get('security.context')->getToken()->getUser()->getId(); $fechaCita = $request->get('fechaCita'); $citaEstado = "cita no confirmada"; $FosUser = $em->getRepository('SISUSGCBundle:FosUser')->findOneBy(array('id' => $id)); $entity->setId($FosUser); $entity->setFechaCita(new \DateTime($fechaCita)); $entity->setCitaEstado($citaEstado); $em->merge($entity); $em->flush(); return $this->redirect($this->generateUrl('sisusgc_home')); } return $this->render('SISUSGCBundle:Default:new.html.twig'); }
/** * {@inheritDoc} */ public function setCitaEstado($citaEstado) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCitaEstado', [$citaEstado]); return parent::setCitaEstado($citaEstado); }