pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gyozo Papp <pgerzson@freestart.hu>
To: [PHP] PostgreSQL <pgsql-php@postgresql.org>
Subject: inherited method call
Date: Sat, 28 Apr 2001 12:55:27 +0200
Message-ID: <01d701c0cfd1$da709660$1a49c5d5@jaguar> (raw)
References: <000b01c0cf30$c86adbc0$0200a8c0@server>
	<002801c0cf37$90aece60$330a0a0a@rutgersinsurance.com>

Hello,

my question is related to just PHP not postgres, but I hope you'll be so kind to help me.
So, how can I call an inherited method which is overriden in the derived class?
a short exmple - if my explanation is not so clear to unterstand:

class A {
    var $x;
    function A() { $this->x = 0; }
    function f1($x) { $this->x = ++$x; }
}

class B extends A 
{
    function B() {$this->x = 1; }

    function f1($x) 
    {
# now I want to access the original f1() function, ie .:
        // $this->f1($x*4);
# and perform some  additional operations ie.:
        // $this->x *= 2;
    }
}

Is there any possilbe work-around 
    or I have to duplicate the code of the inherited function,
    or leave functions the same and create new functions which calls the inherited ones?







view thread (3+ messages)  latest in thread

Message-ID: <01d701c0cfd1$da709660$1a49c5d5@jaguar>
Permalink:  ../01d701c0cfd1$da709660$1a49c5d5@jaguar/
Also on:    postgresql.org/message-id/01d701c0cfd1$da709660$1a49c5d5@jaguar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: pgerzson@freestart.hu
  Subject: Re: inherited method call
  In-Reply-To: <01d701c0cfd1$da709660$1a49c5d5@jaguar>
  References: <000b01c0cf30$c86adbc0$0200a8c0@server> <002801c0cf37$90aece60$330a0a0a@rutgersinsurance.com> <01d701c0cfd1$da709660$1a49c5d5@jaguar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox