Here is the situation:
I have a Model A and Model B. Model A has a foreign key (modelb_id) for Model B.
Both models have their form. I'm embedding the form for Model B into the form A.
class ModelAForm extends ....{
public function configure(){
unset($this['modelb_id']);
$this->embedRelation('ModelB');
}
}
The problem:
When I save the form, it does save the ModelB, but it doesn't change the value of the foreign key in ModelA (in model A, the modelb_id is still empty).
Anyone has a clue?
I always had problems with
embedRelation()
until I found a plugin named ahDoctrineEasyEmbeddedRelationsPlugin which solved ALL of my embedding issues with forms.I believe that it is better to use this plugin than to debug your embeds over and over. :)