Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33280 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91089 invoked by uid 1010); 19 Nov 2007 05:30:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91074 invoked from network); 19 Nov 2007 05:30:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2007 05:30:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 205.234.132.11 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 205.234.132.11 scottsdale.servershost.net Received: from [205.234.132.11] ([205.234.132.11:38249] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/8C-31009-C7F11474 for ; Mon, 19 Nov 2007 00:30:36 -0500 Received: from [216.15.51.211] (port=50738 helo=[192.168.1.90]) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1ItzDR-0003js-Gm for internals@lists.php.net; Sun, 18 Nov 2007 23:30:37 -0600 To: internals@lists.php.net In-Reply-To: References: <1195140437.23612.5.camel@sbarrow-desktop> <10610581037.20071115172619@marcus-boerger.de> <7d5a202f0711181452h3b6a26b8x5b838b585c552765@mail.gmail.com> <7f3ed2c30711181624r7a0c77ddh6f9e86fa3c862133@mail.gmail.com> Content-Type: text/plain Date: Mon, 19 Nov 2007 00:30:32 -0500 Message-ID: <1195450232.12342.25.camel@sams-room> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scottsdale.servershost.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sambarrow.com X-Source: X-Source-Args: X-Source-Dir: Subject: Multiple class inheritance From: sam@sambarrow.com (Sam Barrow) 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.