Re: [PHP] Inheritance of class methods

2008-10-23 Thread Jochem Maas
Alain Roger schreef: > Hi, > > i have the following classes: > class A > { > public function EchoMe($txt) > { > echo $txt; > } > } > > class B extends A > { > ... > } > > in theory i can write something like that: > > $b = new B(); > $b->EchoMe("test"); > > and i should get echo "t

Re: [PHP] Inheritance of class methods

2008-10-23 Thread Yeti
Using extends means that a class IS-A substructure of its parent class(es). EXAMPLE: class plant { }; class tree extends plant { }; class apple_tree extends tree { }; apple_tree inherits all methods and attributes from plant and tree So if there was a methods plant->growth() you can also call it

Re: [PHP] inheritance php4

2006-12-12 Thread Brad Bonkoski
bruce wrote: hi... haven't used php classes.. so this might not pertain.. but do php classes have the concept of public/private functions? Not in PHP 4 are the parent functions that you're trying to access public/private? -Original Message- From: blackwater dev [mailto:[EMAIL PROTE

RE: [PHP] inheritance php4

2006-12-12 Thread bruce
hi... haven't used php classes.. so this might not pertain.. but do php classes have the concept of public/private functions? are the parent functions that you're trying to access public/private? -Original Message- From: blackwater dev [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 1

Re: [PHP] Inheritance problem

2002-12-01 Thread Ernest E Vogelsinger
At 13:05 01.12.2002, Bernard Chamberland said: [snip] >Hi, [snip] [...omitting long code post...] Bernard, couple of things: a) Class "Ressource" uses instance data ("$this->") in the constructor. You shouldn't call

Re: [PHP] Inheritance problem

2002-12-01 Thread Tom Rogers
Hi, Sunday, December 1, 2002, 10:05:53 PM, you wrote: BC> Hi, BC> I would like to post the following question related to an inheritance BC> problem with PHP OO programming : BC> With an object of a subclass, I call a method of the parentclass in order BC> to modify an attribute of the parentc

RE: [PHP] Inheritance Question

2002-10-08 Thread Martin Towell
If you need to use variables that are stored in the object, then use $this->jk(); If you're calling bar::do_something(); then $this wont be set, so you'll need to use foo::jk() instead. If you're calling jk() from an object, and you don't need to use any object attributes, then either way would

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-03 Thread Debbie Dyer
very different to what I know and does (is) causing confusion. Debbie - Original Message - From: "Debbie Dyer" <[EMAIL PROTECTED]> To: "Rasmus Lerdorf" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 11:41 PM Subject: Re:

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
have to know on what class they were called. anyway thanks again /nick - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Nick Eby" <[EMAIL PROTECTED]> Cc: "Debbie Dyer" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent:

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Debbie Dyer
"Debbie Dyer" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 11:28 PM Subject: Re: [PHP] Inheritance and a class function: on what class was it called? > Since static method calls are completely disconnected from any class > instance aski

Re: [PHP] Inheritance and a class function: on what class was itcalled?

2002-10-02 Thread Rasmus Lerdorf
aticFunc() { echo get_class($this); } > } > > Class B extends A {} > > B::staticFunc(); > > thanks again > /nick > > - Original Message - > From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> > To: "Debbie Dyer" <[EMAIL PROTECTED]>

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
PROTECTED]> Sent: Wednesday, October 02, 2002 3:08 PM Subject: Re: [PHP] Inheritance and a class function: on what class was it called? > > The mistake is mine not yours. I know about the :: operator I use it all the > > time (but within classes parent::function() etc) - but I neve

Re: [PHP] Inheritance and a class function: on what class was itcalled?

2002-10-02 Thread Rasmus Lerdorf
> The mistake is mine not yours. I know about the :: operator I use it all the > time (but within classes parent::function() etc) - but I never realised > until now that PHP will let you use any class before instantiation (and > nearly all my PHP work uses classes). I have never even attempted to

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Debbie Dyer
bbie - Original Message - From: "Nick Eby" <[EMAIL PROTECTED]> To: "Debbie Dyer" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 7:53 PM Subject: Re: [PHP] Inheritance and a class function: on what class was it called?

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
esult. sorry this is so confusing, I probably should've used the term "static" from the beginning. /nick - Original Message - From: "Debbie Dyer" <[EMAIL PROTECTED]> To: "Nick Eby" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wedn

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Debbie Dyer
nt: Wednesday, October 02, 2002 7:24 PM Subject: Re: [PHP] Inheritance and a class function: on what class was it called? > not quite... the case I'm interested in is this, given your example: > > print C::foo(); > > which would print nothing, unfortunately, since when the function

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
not quite... the case I'm interested in is this, given your example: print C::foo(); which would print nothing, unfortunately, since when the function is called using the :: operator there is no $this variable. basically what I'm looking for is a replacement for get_class($this) when the functi

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Debbie Dyer
I think I know what you mean. You could get it to return the name of the class. eg. class A { function foo () { return get_class($this); } } class B extends A { } class C extends A { } $a = new A(); $b = new B(); $c = new C(); print $a->foo(); print $b->foo(); print $c

Re: [PHP] Inheritance

2002-07-12 Thread Alberto Serra
ðÒÉ×ÅÔ! > if you have multilayered inheritance you may explicitely say which > anceStor class you are calling, like foo::print(). two typos in a few words are definitely too much, sorry :) BTW, although almost all class specification is dynamic you cannot dynamically specify a class name in f

Re: [PHP] Inheritance

2002-07-12 Thread Alberto Serra
ðÒÉ×ÅÔ! Jason White wrote: > I have a class Foo{} which has a method Print(). > I have another class FooBar{} which extends Foo{} and has its own method > Print(). > > How do I invoke Foo{}'s Print() method from within FooBar{} once its been > overridden? parent::print(); if you have multilaye