[PHP] PHP5 OOP: Abstract classes, multiple inheritance and constructors

2013-06-21 Thread Micky Hulse
Example/working code here: https://gist.github.com/mhulse/5833826 Couple questions: 1. Is there anything wrong with the way I'm using the abstract class? If so, how could I improve the logic/setup? 2. Is there a way for me to pass $foo to the parent class, from the child, without having to

Re: [PHP] PHP5 oop question...

2007-05-28 Thread Stut
Andrei wrote: Hi list, I have a class which I use to parse simple bbcode inside some comments. I noticed on PHP5 that scope of preg_replace function is changed when function is called inside a class. To the point: [CODE] class PHS_editor { ... function parse_content( $str

Re: [PHP] PHP5 oop question...

2007-05-28 Thread Andrei
Stut wrote: Andrei wrote: Hi list, I have a class which I use to parse simple bbcode inside some comments. I noticed on PHP5 that scope of preg_replace function is changed when function is called inside a class. To the point: [CODE] class PHS_editor { ...

[PHP] php5 oop question

2007-04-12 Thread Jim Lucas
Ok, I have seen many different examples of OOP, but nothing quite like this. Someone was showing me syntax for Ruby the other day, and it got me thinking, wouldn't it be neat to imitate ruby, or be it a little more generic, dot notation for OOP ways of calling methods like Java, javascript,

Re: [PHP] php5 oop question

2007-04-12 Thread Paul Scott
On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: Has anybody else seen this style of syntax? http://5ive.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=init_8059_1163957717userid=5729061010 I don't think that its really useful for anything, except maybe creating overly complex SQL

Re: [PHP] php5 oop question

2007-04-12 Thread Jim Lucas
Paul Scott wrote: On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: Has anybody else seen this style of syntax? http://5ive.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=init_8059_1163957717userid=5729061010 I don't think that its really useful for anything, except maybe creating

Re: [PHP] php5 oop question

2007-04-12 Thread Jim Lucas
Paul Scott wrote: On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: Has anybody else seen this style of syntax? http://5ive.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=init_8059_1163957717userid=5729061010 I don't think that its really useful for anything, except maybe creating

Re: [PHP] php5 oop question

2007-04-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-04-11 23:36:56 -0700: Paul Scott wrote: On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: Has anybody else seen this style of syntax? I don't think that its really useful for anything, except maybe creating overly complex SQL queries. What about using it for

Re: [PHP] php5 oop question

2007-04-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-04-11 23:44:16 -0700: Paul Scott wrote: On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: Has anybody else seen this style of syntax? http://5ive.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=init_8059_1163957717userid=5729061010 I don't think that

Re: [PHP] php5 oop question

2007-04-12 Thread Tim Stiles
I've seen it referred to as a Fluent Interface. I built one just to see how hard it was, using a standard problem: data validation. The results were promising. I combined it with an object designed to work as a factory for an internally stored decorator pattern. Class Input was the

Re: [PHP] php5 oop question

2007-04-12 Thread Tim Stiles
I suppose I should have summarized what I learned from that experiment, putting myself more squarely on topic: Simply put, a Fluent interface let me move from $_input-addCheck('Integer'); $_input-addCheck('Range',3,9); $_input-addCheck('NonEmpty'); to $_input-addCheck('Integer')

Re: [PHP] php5 oop question

2007-04-12 Thread Jochem Maas
nice write up. :-) Tim Stiles wrote: I suppose I should have summarized what I learned from that experiment, putting myself more squarely on topic: Simply put, a Fluent interface let me move from /snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] php5 oop question

2007-04-12 Thread Richard Lynch
a) I don't see how the part about the dot notation has anything to do with the class presetned b) I don't see any benefit to the class presented c) Trying to follow the chain of - operators and method calls just gave me a headache. Other than that, it's really nifty. :-v On Thu, April 12, 2007

Re: [PHP] php5 oop question

2007-04-12 Thread Larry Garfield
I have never heard that described as a fluent interface before, but you'd probably like jQuery. :-) It's a javascript library that uses much the same concept, although it refers to it as function chaining. It also operates on multiple objects simultaneously, which is even niftier. On

[PHP] PHP5 OOP how do I get the list of all classes dynamically?

2005-10-05 Thread Daevid Vincent
I have a class class XMLRule { ... } And many of these: class is_username extends XMLRule { } class is_device extends XMLRule { } Is there a way in PHP5 to get a list of all the 'extends' classes I have

[PHP] PHP5 OOP

2004-09-10 Thread Ed Lazor
Any recommendations on the best PHP5 OOP book to get? I have Advanced PHP Programming by George Schlossnagle. It's turning out to be a great book, but I'd like to read more on PHP5 OOP. The first chapter recommends two books, but both deal with OOP from the perspective of C++, C#, and Perl.

Re: [PHP] PHP5 OOP

2004-09-10 Thread Greg Donald
On Fri, 10 Sep 2004 15:09:57 -0700, Ed Lazor [EMAIL PROTECTED] wrote: Any recommendations on the best PHP5 OOP book to get? I have Advanced PHP Programming by George Schlossnagle. It's turning out to be a great book, but I'd like to read more on PHP5 OOP. The first chapter recommends two

Re: [PHP] PHP5 OOP

2004-09-10 Thread Greg Beaver
Greg Donald wrote: On Fri, 10 Sep 2004 15:09:57 -0700, Ed Lazor [EMAIL PROTECTED] wrote: Any recommendations on the best PHP5 OOP book to get? I have Advanced PHP Programming by George Schlossnagle. It's turning out to be a great book, but I'd like to read more on PHP5 OOP. The first chapter

Re: [PHP] PHP5 OOP

2004-09-10 Thread John Holmes
On Fri, 10 Sep 2004 15:09:57 -0700, Ed Lazor [EMAIL PROTECTED] wrote: Any recommendations on the best PHP5 OOP book to get? I have Advanced PHP Programming by George Schlossnagle. It's turning out to be a great book, but I'd like to read more on PHP5 OOP. The first chapter recommends two books,

RE: [PHP] PHP5 OOP

2004-09-10 Thread Ed Lazor
Thanks everyone for the recommendations =) -Original Message- On Fri, 10 Sep 2004 15:09:57 -0700, Ed Lazor [EMAIL PROTECTED] wrote: Any recommendations on the best PHP5 OOP book to get? I have Advanced PHP Programming by George Schlossnagle. It's turning out to be a great book,

[PHP] PHP5 OOP

2004-08-10 Thread Joel Kitching
Hello, I'm trying to get the hang of OOP here but can't quite figure out how to relate these classes. I've got one for the main project, one for the database, and one for a user. Somehow I need to get the user access to the database, without cumbersome constructor calls involving a copy of the

Re: [PHP] PHP5 OOP

2004-08-10 Thread Matthew Sims
Hello, I'm trying to get the hang of OOP here but can't quite figure out how to relate these classes. I've got one for the main project, one for the database, and one for a user. Somehow I need to get the user access to the database, without cumbersome constructor calls involving a copy of

Re: [PHP] PHP5 OOP

2004-08-10 Thread John W. Holmes
From: Joel Kitching [EMAIL PROTECTED] Hello, I'm trying to get the hang of OOP here but can't quite figure out how to relate these classes. I've got one for the main project, one for the database, and one for a user. Somehow I need to get the user access to the database, without cumbersome

[PHP] PHP5 - OOP Question

2004-08-09 Thread Hardik Doshi
Hello Group, I would like to know which one is the most appropriate way to implement the following scenario. For example, I want to display a products catalogue of 100 products. I do have a base class of product which contains all the basic property of the product (Product title, product

Re: [PHP] PHP5 - OOP Question

2004-08-09 Thread Robert Cummings
On Mon, 2004-08-09 at 22:29, Hardik Doshi wrote: Hello Group, I would like to know which one is the most appropriate way to implement the following scenario. For example, I want to display a products catalogue of 100 products. I do have a base class of product which contains all the

Re: [PHP] PHP5 - OOP Question

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 19:29, Hardik Doshi wrote: Hello Group, I would like to know which one is the most appropriate way to implement the following scenario. For example, I want to display a products catalogue of 100 products. I do have a base class of product which contains all the

Re: [PHP] PHP5 - OOP Question

2004-08-09 Thread Curt Zirzow
* Thus wrote Hardik Doshi: Hello Group, I would like to know which one is the most appropriate way to implement the following scenario. For example, I want to display a products catalogue of 100 products. I do have a base class of product which contains all the basic property of the