note 27105 rejected from keyword.parent by didou
| From: | didou@php.net | Date: | Wed, 14 Jan 2004 12:25:27 +0000 |
| Subject: | note 27105 rejected from keyword.parent by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63524@lists.php.net to get a copy of this message | ||
Note Submitter: brian@n2solutions.com
----
How do you best use inheritence without completely rewriting functions when new object attributes
are needed for the class and have to be stored in a db?
Ex:
a generic article class has attributes:
- title
- content
- date created
a derived class needs to add:
- date published
- category
Do I have to rewrite my create function with a complete new SQL statement, anybody have a good
practice to make this easy to implement without re-coding the whole class to add the database
changes?