Extend existing fields and self::

More
10 years 1 month ago #49738 by jrodgar
Hi!

I wanted to extend some field behaviour and my first idea was extending from it. Nevertheless, I couldn´t, because as long as I saw, there were some checks based on self:: function that didn´t work properly because how "self::" works. I think that some of this behaviour could be done with "$this->", that won´t generate inheritance problems. I´m correct?

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #49740 by ggppdk
Hello

self::

was used for PHP 5.2 or PHP 5.3 compatibility
i don't remember now



because of it,
you will have to copy ALL functions and rewrite their code



effectively the self::
- partially damages heritage and turn polumorfism "off"


in future we will replace it by $this

please read this:
www.programmerinterview.com/inde ... f-vs-this/


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 1 month ago #49742 by ggppdk
Hello

ggppdk wrote: in future we will replace it by $this


hhmm i meant we will replace

self::

with

static::

that allow heritage and polymorfism to work more properly,
that is when we stop PHP 5.2, 5.3 support


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.601 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline