• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Extending Class with self::

Marcus

Well-known member
#1
When I extend a class with self:: and reusing something of its code at the beginning to check (calling the parent function later), from my understanding I should have to change self:: with $this, is that correct?

Or has self:: also access to the parent functions my class is extending?
 

Marcus

Well-known member
#3
PHP:
class Alerts_Model_Alert extends XFCP_Alerts_Model_Alert
{
public function markAllAlertsReadForUser($userId, $time = null)
  {
  if (self::PREVENT_MARK_READ)
  {
  return;
  }
So this code in my addon would also check against the extended classes constant PREVENT_MARK_THREAD, is that right?