What is the general opinion on multiple class inheritance. I have a need
for it. I have objects for all user input fields.

$username = new field ;
$username -> name = 'username' ;
$username -> maxLen = 32 ;

I have three types of fields. Fields that are automatically put in the
database, such as timestamps, fields that are inputted but not stored,
such as "confirm password", and fields that are inputted by the user AND
stored in the database, such as username and password.

Now i have 3 classes:

- abstractField (has methods and properties that apply to all fields).
- inputField, extends abstractField (has methods and properties for
display of input form elements and labels).
- dbField, extends abstractField (has methods for storing and retrieving
in db, etc.).

However for fields that are inputted AND stored in the db, i need to
extend both inputField and dbField.

- inputDbField extends inputField, dbField.

Sure, there may be quick hacks to do this, but the only proper way seems
to be to extend both classes, and I don't want to duplicate any code
(dbField and inputField are both pretty big, and any modifications will
also have to be replicated).

And no, I don't want to use interfaces. Interfaces will barely do
anything for me, I'll still have to duplicate my method bodies, and
properties.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to