public function populateFromQuote(FormPopulatingEvent $event) { if (null !== ($id = $event->getParam('quote'))) { $quote = $this->om->getRepository('JLMCommerceBundle:Quote')->find($id); $entity = BillFactory::create(new VariantBillBuilder($quote)); $event->getForm()->setData($entity); } }
public function populateFromDoor(FormPopulatingEvent $event) { if (null !== ($id = $event->getParam('installation'))) { $install = $this->om->getRepository('JLMModelBundle:Door')->find($id); $entity = BillFactory::create(new DoorBillBuilder($install)); $event->getForm()->setData($entity); } }