Re: inherited method call

From: Jason k Larson <jlarson(at)harrison(dot)org>
To: "Gyozo Papp" <pgerzson(at)freestart(dot)hu>
Cc: "[PHP] PostgreSQL" <pgsql-php(at)postgresql(dot)org>
Subject: Re: inherited method call
Date: 2001-04-28 23:38:14
Message-ID: 181165689890.20010428173814@harrison.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

I know you can do a few simple things like determine if it's a
subclass and get the parent classes name, etc.

Here's where I found some info.
http://www.php.net/manual/en/ref.classobj.php

Maybe this will help .. maybe it won't.

Jason k Larson
<?echo(join(" ",split("[.]",base64_decode(strrev("=8iKuIXZrNWYI5CUIBlLyVGa09mbB5CdzVnSuoyL")))));?>

GP> Hello,

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

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

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

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

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

GP> ---------------------------(end of broadcast)---------------------------
GP> TIP 5: Have you checked our extensive FAQ?

GP> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Gyozo Papp 2001-04-29 11:50:38 inherited method call - I got it!
Previous Message Roberto Mello 2001-04-28 23:20:46 Re: HTTP authentication