My model looks like this: 
Order --1----m-- Address --1---m-- AddressType 
Actually there are 3 different AddressType. 
I would like to split the collection of Address in these 3 types in my form. 


Actually, I tried it with this code: 
$builder->add('send_addresses', 'collection', array(
   'type' => new AddressEdit(), 
   "allow_add" => true, 
   "allow_delete" => true, 
   "options" => array( 'label' => 'Address', ), 
));

$builder->add('receive_addresses', 'collection', array(
    'type' => new AddressEdit(), 
    "allow_add" => true, 
    "allow_delete" => true, 
    "options" => array( 'label' => 'Address', ), 
)); 

$builder->add('third_addresses', 'collection', array(
    'type' => new AddressEdit(), 
    "allow_add" => true, 
    "allow_delete" => true, 
    "options" => array( 'label' => 'Address', ), 
)); 

The class AddressEdit is a Subform. My problem is that I can't read or write 
the addresses on the Order- entity. 
I tried to add setter and getter for the collections (like 
getThirdAddresses() and setThirdAdresses()) but it only shows the form and 
don't save the added adresses.

Does anybody know how to solve this problem?
Thanks.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to