symfony - Render a form with some join entity -


i have 3 entities: customer contract (every customer have 1 or more contract, contract 1 customer: there onetomany relation between customer , contract) invoice (every invoice refer 1 or more contract, every contract have 1 or more invoice: there manytomany relation between contract , invoice).

now want render invoice form checkbox. write:

->add('contracts',null, array( 'multiple'  => true, 'expanded'  => true  )) 

in invoiceformtype contracts not specific customer.

how it?

thanks in advance. v.

you can't give null form type. use own contractstype instead:

$builder->add('contracts', new contractstype(), array(      'multiple' => true,      'expanded' => true )); 

see docs more information.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -