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

Jochen Rau jochen.rau at typoplanet.de
Mon Apr 19 11:01:37 CEST 2010


Hi Felix.

On 19.04.10 01:32, Felix Oertel wrote:
> ok, I rewrote the patch and it does not require additional annotations
> anymore. Just use the normal @var annotation like you usually do.

Thanks!

> @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.

Good finding. We should not rely on class_exists (but have to atm). We 
can exclude DateTime from this (hardcoded) but we can not assure that 
there won't be any "new" native PHP classes indication a plain type.

There are some other places in Extbase (like the PropertyMapper) where 
we rely on this information, too.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list