/** * {@inheritdoc} */ public function buildCustomer() { $this->bill->setTrustee($this->trustee); $this->bill->setTrusteeName($this->trustee->getBillLabel()); $this->bill->setTrusteeAddress($this->trustee->getBillAddress()->toString()); $this->bill->setAccountNumber($this->trustee->getAccountNumber() == null ? '411000' : $this->trustee->getAccountNumber()); }
/** * Creates a new Trustee entity. * * @Template("JLMModelBundle:Trustee:contactnew.html.twig") * @Secure(roles="ROLE_USER") */ public function contactcreateAction(Trustee $trustee) { $em = $this->getDoctrine()->getManager(); $entity = ContactManager::create('Person'); $request = $this->getRequest(); $form = $this->createForm(new PersonType(), $entity); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $trustee->addContact($entity); $em->persist($entity); $em->persist($trustee); $em->flush(); return $this->redirect($this->generateUrl('trustee_show', array('id' => $trustee->getId()))); } return array('trustee' => $trustee, 'entity' => $entity, 'form' => $form->createView()); }