[FLOW3-general] Relations of created sub-properties

"Christian Müller (Kitsunet)" christian.mueller at typo3.org
Tue Nov 15 12:11:07 CET 2011


Hi Helmut,

I am sorry, must have been still a bit sleepy this morning and mistook 
your question....

So to give you at least a partly answer to your real problem.

Indeed doctrine forces you to set the association on the "One" side of a 
OneToMany just as you experienced. That is not a bug but a feature ;)

I will see if we have some best practice code for your use case, as I 
don't know any out of my mind atm.

Cheers,
Christian

On 15/11/11 10:51, Helmut Hummel wrote:
> Hi Christian,
>
> thanks for your response.
>
> On 15.11.11 08:39, "Christian Müller (Kitsunet)" wrote:
>
>> 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 :)
>
> You mean:
> $this->arguments['newConcert']->getPropertyMappingConfiguration()->allowCreationForSubProperty('artists.0');
>
>
>
>> 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.
>
> I know and I did ;) Just have a quick look into my code example I provided.
>
> That's not the problem. Both objects are created, but the artist object
> is not associated to the concert object, if I do not explicitly assign
> the concert to the artist (which I find weird if I had to).
>
> To me it looks like a bug (or a missing feature), but I may be mistaken...
>
> Kind regards,
> Helmut
>




More information about the FLOW3-general mailing list