[FLOW3-general] Relations of created sub-properties

Colin & Maureen Pridham cmbigsnow at bigpond.com
Tue Nov 15 12:25:57 CET 2011


How do I stop this mailing list?

Thanks,
Colin

-----Original Message-----
From: flow3-general-bounces at lists.typo3.org
[mailto:flow3-general-bounces at lists.typo3.org] On Behalf Of "Christian
Müller (Kitsunet)"
Sent: Tuesday, 15 November 2011 6:09 PM
To: flow3-general at lists.typo3.org
Subject: Re: [FLOW3-general] Relations of created sub-properties

On 15/11/11 01:36, Helmut Hummel wrote:
> Dear FLOW3 experts,
>
> I have a simple many to one relation with two objects, one of them 
> being the aggregate root. When I now have a form to create the 
> aggregate root object with one association, both objects are created, 
> but the relation is lost. In my case the "Artist" is not associated to the
concert.
>
>
> Of course I can add
>
> foreach ($newConcert->getArtists() as $artist) { 
> $artist->setConcert($newConcert); }
>
> to the createAction. But it seems a bit odd to me that this is necessary.
>
> I attached the code I have. What am I missing?
>
>
> Kind regards,
> Helmut
>

Hi Helmut,

what you have to do is to explicitly allow the property mapper to create new
sub objects in a certain action. That seems to be the biggest pitfall for
many so far :)

Look into the older thread "Initialize create action for an unknown number
of properties" there is a code example for this, but I think in the
PropertyMapper Documentation is also something.

Cheers,
Christian
_______________________________________________
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