[TYPO3-mvc] Extending another extensions sub-models (single table inheritance)

Franz Koch typo3.RemoveForMessage at elements-net.de
Fri Jan 21 11:28:26 CET 2011


Hey,

> Imagine the following model structure:
>
> Extension 1
>
> Model: Contact
> * Model: Person (extends Contact)
> * Model: Corporation (extends Contact)
>
> Extension 2
>
> Model: Client extends Contact (from Extension)
> * Model: Person (?)
> * Model: Corporation (?)
...
> And if I do it like this:
>
> Extension 2
>
> Model: Person extends Person (from Extension 1)
> Model: Corporation extends Corporation (from Extension 1)
>
> then I will lose methods of the model 'Client' from Extension 2.

I'd go that way, although it means that you have to add all new "client" 
methods also to the subclasses.

> Is there any solution to this or is this still a weak point of Extbase?

no, not yet. Mixins might someday be a solution for this, but with 
mixins you would alter the original class from Extension 1 which might 
also not be what you want in this case, because the mixin wouldn't be 
limited to Extension 2 but would alter ALL places where Extension 
1->Contact is used.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list