[FLOW3-general] Relations of created sub-properties

Helmut Hummel helmut.hummel at typo3.org
Wed Nov 16 09:24:14 CET 2011


Hi Christian,

On 15.11.11 12:11, "Christian Müller (Kitsunet)" wrote:

> 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;)

Hmm.. but I need to set the relation on the "Many" side. Again my problem:

Concert: one- inversed side
Artist: many- owning side


I want to create a Concert with one Artist, thus creating a form for a 
concert and a field for the artist property:

<f:form.textbox id="artist" property="artists.0.name" />


In the controller I expect a Concert object:

public function createAction(Concert $newConcert)


And this is what I get:

A Concert object, which has one Artist object associated. But when I 
var_dump the concert property of the Artist object, it is empty.

So the owning (many) side has a missing relation and the inversed side 
(one) has the correct relation.

And the owning side is what get's persisted, so relation is lost after 
persisting.

This sounds so strange, that this should be 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.

That would be awesome.


Kind regards,
Helmut

-- 
Helmut Hummel
TYPO3 Security Team Leader, TYPO3 v4 Core Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the FLOW3-general mailing list