[TYPO3-core] RFC #14171: Bug: XCLASS in class.t3lib_matchcondition_abstract.php is missing
Franz Holzinger
franz at ttproducts.de
Fri Apr 23 19:28:00 CEST 2010
Thorsten Kahler a écrit :
> Hi Kjeld,
>
> schrieb Kjeld Schumacher am 23.04.10 15:51:
>> This is an SVN patch request.
>>
>> Type: Bugfix
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=14171
>>
>> Branches:
>> 4.4, trunk
>>
>> Problem:
>> XCLASS in class.t3lib_matchcondition_abstract.php is missing
>>
>
> without taking a look into the code: how should XCLASSing an /abstract/
> class work? Abstract classes are never instantiated but only extended by
> (concrete) classes.
>
> Cheers
> Thorsten
Indeed, an inherited class cannot use the XCLASS feature, because the
class name in the XCLASS file would be ux_t3lib_matchCondition_abstract.
However the other classes cannot be changed any more to be derived from
ux_t3lib_matchCondition_abstract instead of t3lib_matchCondition_abstract:
class ux_t3lib_matchCondition_abstract extends
t3lib_matchCondition_abstract {
The class t3lib/matchcondition/class.t3lib_matchcondition_abstract.php
must be changed in a way, that it gets a new member variable class
$funcObj. This must be an object of a new separate class
t3lib_matchCondition_new_class. No inheritance must be used here.
Initalization would be in
public function __construct().
Then all the methods of t3lib_matchCondition_abstract which contain
code must be moved into the new class t3lib_matchCondition_new_class.
Then the XCLASS can be inserted within t3lib_matchCondition_new_class .
The usage of class inheritance is a bad design. It is much better to use
small member objects instead of it.
- Franz
More information about the TYPO3-team-core
mailing list