RE: [PHP] Classes - Dumb question
| From: | Jay Blanchard | Date: | Mon, 15 Oct 2007 10:42:57 +0000 |
| Subject: | RE: [PHP] Classes - Dumb question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263206@lists.php.net to get a copy of this message | ||
[snip]
>With a class you can inherit all of the base class functionality
>into a new customer type. You do not have to break open the base
>class to add a case, you just have to create an extension class.
>Documentation is unique to each class.
No matter what, you have to break something open to add code -- if
nothing else, the script.
[/snip]
The base class would (should?) be contained in its own script space. For instance you might have the
customer class in a file called class.customer.php. You do not have to open this script to add
another class or extend this class, you would just add another file like
class.customerCommercial.php that extends the customer class. Since autoload is available now
(http://www.php.net/autoload) you would not even have to open the 'calling' script to add
an include line.