[TYPO3-mvc] Annotaion based relation-type-detection

Felix Oertel mehl at foertel.com
Mon Apr 19 01:32:47 CEST 2010


Hey,

ok, I rewrote the patch and it does not require additional annotations 
anymore. Just use the normal @var annotation like you usually do.

@var string/int/...
no relation

@var Tx_Extbase_Persistence_ObjectStorage (or classes extending it)
if MM or foreign_selector*: m:n
else: 1:n

@var Tx_YourExt_Domain_Model_Object (NOT extending ObjectStorage)
1:1

!!! Please be aware, that this is just a preview and not the final patch !!!

I have to rewrite the unit-tests and I did not (yet) test, what happens 
with @var DateTime. I guess my patch would assign 1:1 since DateTime is 
a present Class that does not extend ObjectStorage.

So this is just for you guys to have a look and give some feedback. 
(Even so it works out great after some testing with the common used types.)

regards, foertel

* - m:n relations by foreign_selector will most likey be dropped in one 
of the next extbase versions.


More information about the TYPO3-project-typo3v4mvc mailing list