private function setRegistrationStatus(Registration $registration, $status) { $registration->setStatus($status); $em = $this->getDoctrine()->getManager(); $em->persist($registration); $em->flush(); }
/** * @Given /^que existen las inscripciones:$/ */ public function createStudentDelegation(TableNode $tableNode) { foreach ($tableNode->getHash() as $registrationHash) { $user = $this->getEntityManager()->getRepository('AppBundle:User')->findOneBy(['username' => $registrationHash['usuario']]); $convention = $this->getEntityManager()->getRepository('AppBundle:Convention')->findOneBy(['slug' => $registrationHash['asamblea']]); $registration = new Registration(); $registration->setUser($user); $registration->setName($registrationHash['nombre']); $registration->setPosition($registrationHash['cargo']); $registration->setConvention($convention); $registration->setStatus($registrationHash['estado']); $this->getEntityManager()->persist($registration); } $this->getEntityManager()->flush(); }