php - setVariables() many to many relation symfony2 -


i have many many relation between let's entitya , entityb , use embeeded forms in order add attribute of entitya in form of entityb follows

$builder ->add('entityas', 'entity', array(               'class'    => 'xxxbundle:entitya',               'property' => 'name',               'multiple' => false,             ));} 

when set 'multiple' true, ok. when set false, following error

property "entityas" not public in class "xxx\entity\entityb". maybe should create method "setentityas()"? 

as usual property entityas in entityb class not public (protected or private). have write (or generate) setter it: setentityas($entityas)

multiple true may work, think (not sure) uses addxxx setter. proof me, if have addentityas method in entityb class?

buuuuut, if have many many relation, why set multiple false?


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -