[PHP] Re: PHP class question

2009-05-21 Thread Nathan Rixham
Peter van der Does wrote: I have the following situation. I wrote some software and split it up into functionality: class core { function go{ } } class A extends core { // PHP4 constructor function A { $this-go(); } } class B extends core { } In core I define functions and

[PHP] Re: PHP class question

2009-05-21 Thread Shawn McKenzie
Peter van der Does wrote: I have the following situation. I wrote some software and split it up into functionality: class core { function go{ } } class A extends core { // PHP4 constructor function A { $this-go(); } } class B extends core { } In core I

Re: [PHP] Re: PHP class question

2009-05-21 Thread Peter van der Does
On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending framework_class. I worded it wrong, I apologize. Class A needs to be an

Re: [PHP] Re: PHP class question

2009-05-21 Thread Shawn McKenzie
Peter van der Does wrote: On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending framework_class. I worded it wrong, I apologize.

Re: [PHP] Re: PHP class question

2009-05-21 Thread Shawn McKenzie
Shawn McKenzie wrote: Peter van der Does wrote: On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending framework_class. I worded it

Re: [PHP] Re: PHP class question

2009-05-21 Thread Nathan Rixham
Shawn McKenzie wrote: Shawn McKenzie wrote: Peter van der Does wrote: On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending

Re: [PHP] Class question

2006-09-15 Thread Thomas Munz
Use 'extends' syntax for sub classes class A { var $some_var; var $class_B; function A(){ $this-class_B = new B(); $this-some_var=2; } } class B extends A { var $class_C; function B(){

Re: [PHP] Class question

2006-09-15 Thread Andrei
Well in this example it will get to an infinite loop, but anyway like Thomas said you must check into extending classes. Andy Thomas Munz wrote: Use 'extends' syntax for sub classes class A { var $some_var; var $class_B; function A(){

Re: [PHP] Class question

2006-09-15 Thread Roger Helgesen
What does $this-A(); do ?(in constructor of class B) does it make another instance of class A, and if not why do I have to parse vars to the A constructor ($this-A($var1,$var2))?. I dont think that is what I want. A can have many instances of B. B can have many instances of C.

RE: [PHP] class question 2

2002-03-27 Thread Rick Emery
Objects which are instantiated from classes on one page are not available on the next page. You have to use session functionality. -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 8:17 PM To: Php-General-List (E-mail) Subject: [PHP]

RE: [PHP] class question 2

2002-03-27 Thread Martin Towell
once their instantiated, they're just like any other variable - that is: if a normal variable, declared in the same place as the object, is accessable in another function, then the object will be too. HTH Martin -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]]

RE: [PHP] Class question

2002-02-20 Thread Hunter, Ray
The whole idea with object-oriented programming is polymorphism and encapsulation. You do not want your classes to access global variables but access that information through objects and messaging between objects. If you are referring to the use of non-member as being outside of the class, then

Re: [PHP] Class question

2002-02-20 Thread Jeff Sheltren
Well, I guess many things are accepted now, but here's my two cents: I wouldn't access global variables, instead you should pass everything you need as parameters. Using global variables can come back to bite you occasionally because you may think you are changing a local variable at one