[FLOW3-general] Values of m:n relationship don't get saved

"Christian Müller (FLOW3 Team)" christian.mueller at typo3.org
Thu Jul 12 08:35:55 CEST 2012


Hi,

did you check that you are setting the relation from the "owning" side? 
You need to annotate your relation with doctrines mappedBy and 
inversedBy attributes, the property you give in mappedBy is the one that 
is used for saving, the other is discarded.
See also [1] maybe that already fixes your problem.

[1] 
http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/association-mapping.html

Otherwise some more information about your models would be good (namely 
both property declarations that make up the relation)

Cheers,
Christian

On 11/07/12 22:50, David Sporer wrote:
> Hi everyone,
>
> I have two models that are connect with a m:n relationship. Everything seems to be working except that the values entered in the edit form don't get stored to the database.
> A valid instance of the model is passed to the repositories update method and doctrine:validate says everything is ok.
> I can also find a table in the database that connects the two models.
> Even the set method of the model seems to set the values correct.
>
> What info do I have to provide so you can perhaps help me out?
>
> Thanks you and best regards
> David
>





More information about the FLOW3-general mailing list