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

David Sporer david.sporer at googlemail.com
Thu Jul 12 20:57:09 CEST 2012


Hi Christian,

thank you! That did the trick - I just needed to change the mappedBy and
inversedBy attributes.

Regards
David

-----Ursprüngliche Nachricht-----
Von: flow3-general-bounces at lists.typo3.org
[mailto:flow3-general-bounces at lists.typo3.org] Im Auftrag von "Christian
Müller (FLOW3 Team)"
Gesendet: Donnerstag, 12. Juli 2012 08:36
An: flow3-general at lists.typo3.org
Betreff: Re: [FLOW3-general] Values of m:n relationship don't get saved

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/asso
ciation-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
>



_______________________________________________
FLOW3-general mailing list
FLOW3-general at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general



More information about the FLOW3-general mailing list