Hi Björn,
2012/11/9 Lange, Björn <[email protected]>:
> Hi Holger,
>
> 2012/11/9 Holger Kohnen <[email protected]>
>>
>> Am 09.11.2012 um 09:39 schrieb Lange, Björn <[email protected]>:
>>
>> Good Morning,
>>
>> 2012/11/9 Holger Kohnen <[email protected]>
>>>
>>> Am 23.10.2012 um 15:44 schrieb "Jungclaus, Tobias"
>>> <[email protected]>:
>>
>>
>>>
>>> I was also in similar situations. Most times i wanted to extend
>>> oxbase or oxubase, but that was not possible because oxid does not
>>> support base class extension. So we create one helper class which is then
>>> utilized by multiple extended classes. This feels not very good because you
>>> even create redundant code but there is no other way in the moment.
>>
>>
>> Sorry to correct you, but there is.
>> Own Autoloader + "eval"-simulation of a non existing class, extending an
>> existing class .... As done by oxid with the *_parent-classes.
>>
>>
>> Maybe i wasn't clear enough.
>> I would like to extend oxbase with a method which i than want to use on
>> oxarticle, oxcategory and all other active record objects.
>
>
> Yes i got you.
> You say, you need to create "redundant code" to extend several classes with
> the same logic. And that there would be no other way to do so. But i think
> this message is wrong. You can prevent redundant code in this special case,
> if you would use a special autoloader and eval your required code.
...so what you mean is:
== module config ==
oxarticle => GenericRecordExtension_Article
oxcategory => GenericRecordExtension_Category
== autoloader ==
if $className matches GenericRecordExtension_*
get content of GenericRecordExtension.php
replace CLASSNAME-Placemark with $className and eval code
== GenericRecordExtension.php ==
class CLASSNAME extends CLASSNAME_parent {
...
}
>
> Regards,
> Björn
>
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general
--
Holger Kohnen
(Webentwickler)
Anklamer Str. 35
10115 Berlin
[email protected]
http://www.holgerkohnen.de
030 / 788 37 22
0173 / 38 62 791
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general