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

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Fri Jan 21 11:35:13 CET 2011


Franz Koch wrote:
> 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.

Thanks for your fast response!

Indeed, I think I will go the way you prefer too.
Unfortunately, as you mentioned, I need to add new
client methods to all subclasses which is bad.

So long,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list