When use "extends xxx/xxx/Article" and when extends "Article_parent"

I want to ask people with more skills…

“extends xxx/xxx/Article” or “extends Article_parent”
What is the differences between this to ways? In which cases we should use those two ways? Or maybe it makes no difference? Some advantages and disadvantages?

p.s of course i now what is ‘extends’ mean :stuck_out_tongue: :slight_smile:

i’m not absolutely shure about v6, but before v6 there was:
test extends test_parent for extending a class for adding new or changing existing functions.
test extends oxarticle is for class Inheritance when adding a whole new class.

yes, sure… but i can’t imagine task where solution for it is the only one of those ways.
At this moment i think that everything we want to do, we can do with these two ways… and it will work ok. But it can’t be true because why oxid team would do this if they could use normal ‘extends’ like “test extends oxarticle”.

version 6 uses namespaces, version 4 and 5 did not

This will create a new class “test” which has to be instantiated by oxnew(“test”). If “…_parent” is used this will work for instances created by oxnew(“oxarticle”). So usually if you want to change behaviour of instances created by oxnew(“oxarticle”), you would use “_parent” and extends-array, if you want to create your own new classes you would use “extends oxubase” for example and use the files- or controllers-array. Using extends-array with “extends oxarticle” may seem to work but will kill compatibility with other modules.

1 Like