Re: [PHP] OO Question for PHP4

2004-08-11 Thread Justin Patrin
On Wed, 11 Aug 2004 09:14:08 -0600, Jed R. Brubaker <[EMAIL PROTECTED]> wrote: > Hi all. As the subject suggests, I am using PHP4 and am having something > going on that I don't think should be. > > Presume the following code > class Foo { > function Foo () { > return "Bar"; You shoul

Re: [PHP] OO Question for PHP4

2004-08-11 Thread Jason Davidson
Yup, i typo'd .. should have read, Im not sure you should be returning a value.. Jason Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: > > * Jason Davidson <[EMAIL PROTECTED]>: > > Im sure you should be returning a value in your constructor at all?? Ill > > check the manual, but i dont

Re: [PHP] OO Question for PHP4

2004-08-11 Thread David Bevan
On Wed, 2004-08-11 at 11:14, Jed R. Brubaker wrote: > Hi all. As the subject suggests, I am using PHP4 and am having something > going on that I don't think should be. > > Presume the following code > class Foo { > function Foo () { > return "Bar"; > } > } > $foo = new Foo; > echo

Re: [PHP] OO Question for PHP4

2004-08-11 Thread Matthew Weier O'Phinney
* Jason Davidson <[EMAIL PROTECTED]>: > Im sure you should be returning a value in your constructor at all?? Ill > check the manual, but i dont think ive ever seen a constructor return > anything, doesnt sound right.. Let me check. >From my experience, returning a value from a constructor currentl

Re: [PHP] OO Question for PHP4

2004-08-11 Thread Jason Davidson
Im sure you should be returning a value in your constructor at all?? Ill check the manual, but i dont think ive ever seen a constructor return anything, doesnt sound right.. Let me check. Jason "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: > > Hi all. As the subject suggests, I am using PHP4 and

RE: [PHP] OO Question for PHP4

2004-08-11 Thread Jay Blanchard
[snip] Hi all. As the subject suggests, I am using PHP4 and am having something going on that I don't think should be. Presume the following code class Foo { function Foo () { return "Bar"; } } $foo = new Foo; echo $foo; $foo comes out as an object. Does this have to be done in tw

[PHP] OO Question for PHP4

2004-08-11 Thread Jed R. Brubaker
Hi all. As the subject suggests, I am using PHP4 and am having something going on that I don't think should be. Presume the following code class Foo { function Foo () { return "Bar"; } } $foo = new Foo; echo $foo; $foo comes out as an object. Does this have to be done in two line

RE: [PHP] oo question

2004-04-19 Thread Kelly Hallman
Apr 19 at 3:46pm, Chris W. Parker wrote: > Kelly Hallman > > I think what you're talking about here is encapsulation. > > in that case what is abstraction? I suppose it's pretty similar, but I believe that encapsulation is the pedantic term for hiding the data structure

RE: [PHP] oo question

2004-04-19 Thread Chris W. Parker
Kelly Hallman on Monday, April 19, 2004 12:34 PM said: > I think what you're talking about here is encapsulation. in that case what is abstraction? >> PROPOSED CHANGE: >> class Customer { >>... >>function initialize_customer($customer_id) { >>// gra

Re: [PHP] oo question

2004-04-19 Thread Kelly Hallman
Chris, Apr 19 at 10:33am, Chris W. Parker wrote: > my question has to do with abstraction (i think that's the word). I think what you're talking about here is encapsulation. And yes, you are correct to point out that the second approach allows the more encapsulation of the object's data. Using me

Re: [PHP] oo question

2004-04-19 Thread Jordi Canals
Chris W. Parker wrote: hi. i've recently realized that the little "oo" code i've written is actually not very oo at all. it's more like procedural code wrapped in a class. armed with my new knowledge i'm in the process of modifying my current classes to be more oo (or what i like to this is more o

RE: [PHP] oo question

2004-04-19 Thread Chris W. Parker
Chris W. Parker <> on Monday, April 19, 2004 11:03 AM said: > Edward Peloke > on Monday, April 19, 2004 10:49 AM said: > >> this: function Customer($customer_id = 0) >> >> doesn't always set the customer_id to 0 even when you pass one in? > > no. that is the d

RE: [PHP] oo question

2004-04-19 Thread Chris W. Parker
Edward Peloke on Monday, April 19, 2004 10:49 AM said: > this: function Customer($customer_id = 0) > > doesn't always set the customer_id to 0 even when you pass one in? no. that is the default value for a function if *no* value is passed in. chris. -- PHP Gene

RE: [PHP] oo question

2004-04-19 Thread Edward Peloke
ris W. Parker [mailto:[EMAIL PROTECTED] Sent: Monday, April 19, 2004 1:33 PM To: [EMAIL PROTECTED] Subject: [PHP] oo question hi. i've recently realized that the little "oo" code i've written is actually not very oo at all. it's more like procedural code wrapped in a class

[PHP] oo question

2004-04-19 Thread Chris W. Parker
hi. i've recently realized that the little "oo" code i've written is actually not very oo at all. it's more like procedural code wrapped in a class. armed with my new knowledge i'm in the process of modifying my current classes to be more oo (or what i like to this is more oo). so i'm going to as

Re: [PHP] OO Question

2002-06-10 Thread Gerard Samuel
Im no OO coder but I did try this before. I made (well started to anyway) a class that uses two other classes, and yes, $this->that->do_something() did work for me Jay wrote: >I was wondering can I create a new Object inside of a different class? > >class One >{ >//constructor >function O

Re: [PHP] OO Question

2002-06-10 Thread Danny Shepherd
Yes, you can do that and yes that's how you do it :) Danny. - Original Message - From: "Jay" <[EMAIL PROTECTED]> To: "Php-General (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 5:17 PM Subject: [PHP] OO Question > I was wonderi

Re: [PHP] OO Question

2002-06-10 Thread Erik Price
On Monday, June 10, 2002, at 12:17 PM, Jay wrote: > I was wondering can I create a new Object inside of a different class? > > class One > { > //constructor > function One > { > $this->two = new Two; > $this->test = $this->two->test(); > } > } > > Can you do that? If so is that how you do it?

[PHP] OO Question

2002-06-10 Thread Jay
I was wondering can I create a new Object inside of a different class? class One { //constructor function One { $this->two = new Two; $this->test = $this->two->test(); } } Can you do that? If so is that how you do it? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe

RE: [PHP] OO question

2001-12-11 Thread Chris Bailey
You can use the special name "parent". e.g.: parent::baseClassFunction(); -Original Message- From: christian calloway [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 08, 2001 2:16 PM To: [EMAIL PROTECTED] Subject: [PHP] OO question I want to be able to

[PHP] OO question

2001-12-11 Thread christian calloway
I want to be able to override a function/method in a parent class, but then call that function/method from within the overriden function in the child class. The Zend documentation states you can do this: "In PHP 4.0 you can call member functions of other classes from within member functions or fr

[PHP] OO question

2001-12-11 Thread christian calloway
I want to be able to override a function/method in a parent class, but then call that function/method from within the overriden function in the child class. The Zend documentation states you can do this: "In PHP 4.0 you can call member functions of other classes from within member functions or fr