[TYPO3-mvc] Properties from related objects with M:M
Jochen Rau
jochen.rau at typoplanet.de
Tue Mar 30 12:01:22 CEST 2010
Hi Peter.
On 26.03.10 09:36, Peter Niederlag wrote:
>> Background: I have implemented the detection of the type of relation
>> at a point in time where Reflection part of FLOW3 wasn't available in
>> Extbase. So, I had to parse the TCA to detect the type.
>
> That makes some things a lot more clear for me. ;) I was already quite
> puzzled that TCA has influence on the behaviour of querying the
> Model/Repository, when I ran into http://forge.typo3.org/issues/show/6933 .
>
>> [...] But there is a difference between the type of relation and the
>> way how this relation is stored in the database. ATM Extbase don't
>> differentiate the both.
>
> But, how's the roadmap now on this? IMO it would be very cool to use
> reflection and annotations to get the type of relation.
>
> But still then extbase doesn't quite know enough to find out about a
> ..csv foreign_key or _mm implementation if I understand this correct. So,
> how does the current implementation behave?
In the current implementation the type of relation is determined by the
TCA definition of the column.
foreign_table set -> There is a relation
MM or foreign selector set -> RELATION_HAS_AND_BELONGS_TO MANY
foreign_field -> RELATION_HAS_MANY
foreign_field and maxitems=1 -> RELATION_HAS_ONE
But this will change for Extbase 1.2 I am currently working on. See:
http://forge.typo3.org/issues/show/7067
There will be a difference between single and multivalue properties.
This will be determined only by the property annotation: array,
SplObjectStorage Tx_Extbase_Persistence_ObjectStorage results in
multivalue=TRUE, all others in multivalue=FALSE.
In addition Extbase hase to distinguish the technical solutions to store
the relation data. This is determined by parsing the TCA definitions.
Regards
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list