[PHP] PHP OOP Question

2004-09-08 Thread Paul Waring
> Is it bad practice for a class to have a variable and method of the same name? Well, it's a matter of opinion what is and isn't bad practice, but personally I would never give a variable and a function the same name - if only to avoid confusion (PHP shouldn't mind if you do so though). Paul --

[PHP] PHP OOP Question

2004-09-07 Thread ed . lazor
Is it bad practice for a class to have a variable and method of the same name? For example: class product { var $Name; function Name() { return stripslashes($this->Name); } } Thanks, -Ed This message was se

Re: [PHP] OOP Question

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 17:07, Richard Lewis wrote: > What do members think that this code should do: > > class A > { > var $a, $b; > function A($a) > { > $this->$a = $a; > } > function prnt() > { > echo "a=" . $this->$a; > } > } > > class B extends A > { > function B($a, $b

[PHP] OOP Question

2004-04-07 Thread Richard Lewis
What do members think that this code should do: class A { var $a, $b; function A($a) { $this->$a = $a; } function prnt() { echo "a=" . $this->$a; } } class B extends A { function B($a, $b) { parent::A($a); $this->$b = $b; } function prnt() { parent::prn

Re: [PHP] OOP question

2003-06-01 Thread Ernest E Vogelsinger
Just noticed a small glitch in the attach() method - check_object will not be called for the first object. Use this attach() / check_object() implementation instead. The "var $class" instance variable of CTeeObject can be omitted. function attach(&$hObj) { if (!$this->check_object($hObj))

Re: [PHP] OOP question

2003-06-01 Thread Ernest E Vogelsinger
At 08:39 01.06.2003, Jackson Miller said: [snip] >Is it possible to reference two instances of an object at once with a >single variable name while retaining the ability to reference the >objects seperately? [snip] No

Re: [PHP] OOP question

2003-06-01 Thread Rasmus Lerdorf
On Sat, 1 Jun 2003, Jackson Miller wrote: > Is it possible to reference two instances of an object at once with a > single variable name while retaining the ability to reference the > objects seperately? No chance. Well, you could hack it with some really fancy object overloading, but in general,

[PHP] OOP question

2003-06-01 Thread Jackson Miller
Is it possible to reference two instances of an object at once with a single variable name while retaining the ability to reference the objects seperately? I am using the PEAR Template IT package and need to generate two similar but different results at the same time. I am doing this with two ins

Re: [PHP] OOP Question in PHP

2002-06-06 Thread Ilker Cetinkaya
"Scott Hurring" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Depends ;-) yea, really depnds, but as you mentioned, having parameterless constructors are more generic, especially when it comes to derive the classes. > > instead (with option #2), you could

Re: [PHP] OOP Question in PHP

2002-06-05 Thread Daniel Tryba
On Wed, Jun 05, 2002 at 10:32:39PM +0100, Henry Blackman wrote: > Do I create a new document and pass the primary key as it's a variable in > the > > $document = new Document(number); > > and have the constructor retrieve the appropriate data from MySQL and fill > the attribute variables. > > O

RE: [PHP] OOP Question in PHP

2002-06-05 Thread Scott Hurring
t: Wednesday, June 05, 2002 5:33 PM > To: [EMAIL PROTECTED] > Subject: [PHP] OOP Question in PHP > > > Hello. > > I have, what is probably a silly, question. > > I want to convert my existing scripts to OO - because it's > the "way to go" > in term

[PHP] OOP Question in PHP

2002-06-05 Thread Henry Blackman
Hello. I have, what is probably a silly, question. I want to convert my existing scripts to OO - because it's the "way to go" in terms of the huge amount of functionality that they now have (and since I've never done it before it would be interesting). However I have one thing that I don't unde

Re: [PHP] OOP question regarding class extension

2001-03-19 Thread Matt McClanahan
> From: John Guynn [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 19, 2001 1:47 PM > To: Php (E-mail) > Subject: [PHP] OOP question regarding class extension > > > Can one class extend multiple classes? I'm still playing with OOP > functionality and maybe my logic

RE: [PHP] OOP question regarding class extension

2001-03-19 Thread Altunergil, Oktay
onday, March 19, 2001 1:47 PM To: Php (E-mail) Subject: [PHP] OOP question regarding class extension Can one class extend multiple classes? I'm still playing with OOP functionality and maybe my logic is reversed but I think I need one class to extend many others. John Guynn This email br

[PHP] OOP question regarding class extension

2001-03-19 Thread John Guynn
Can one class extend multiple classes? I'm still playing with OOP functionality and maybe my logic is reversed but I think I need one class to extend many others. John Guynn This email brought to you by RFCs 821 and 1225. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-ma