pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedinherited method call
3+ messages / 3 participants
[nested] [flat]
* inherited method call
@ 2001-04-28 10:55 Gyozo Papp <pgerzson@freestart.hu>
0 siblings, 2 replies; 3+ messages in thread
From: Gyozo Papp @ 2001-04-28 10:55 UTC (permalink / raw)
To: pgsql-php
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?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: inherited method call
@ 2001-04-28 22:03 Jesus Aneiros <aneiros@ucfinfo.ucf.edu.cu>
parent: Gyozo Papp <pgerzson@freestart.hu>
1 sibling, 0 replies; 3+ messages in thread
From: Jesus Aneiros @ 2001-04-28 22:03 UTC (permalink / raw)
To: Gyozo Papp <pgerzson@freestart.hu>; +Cc: pgsql-php
I think it is not posible to call an override method. The OO in PHP is far
from being complete.
I hope my answer will be incorrect :-)
Saludos, jesus.
On Sat, 28 Apr 2001, Gyozo Papp wrote:
> 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?
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: inherited method call
@ 2001-04-28 23:38 Jason k Larson <jlarson@harrison.org>
parent: Gyozo Papp <pgerzson@freestart.hu>
1 sibling, 0 replies; 3+ messages in thread
From: Jason k Larson @ 2001-04-28 23:38 UTC (permalink / raw)
To: Gyozo Papp <pgerzson@freestart.hu>; +Cc: 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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-04-28 23:38 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-28 10:55 inherited method call Gyozo Papp <pgerzson@freestart.hu>
2001-04-28 22:03 ` Jesus Aneiros <aneiros@ucfinfo.ucf.edu.cu>
2001-04-28 23:38 ` Jason k Larson <jlarson@harrison.org>
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