Re: Re: DB Exceptions - Sample Code
| From: | Hans L | Date: | Fri, 09 Jul 2004 16:19:09 +0000 |
| Subject: | Re: Re: DB Exceptions - Sample Code | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31804@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Onhe more point: inheritance in php means you can only derive from one parent. dunno if this is a serious limitation for categorization which should however be possible to overcome using error codes.If necessary, you could use interfaces to define the "categories" under which individual exceptions would fall. For example some of the DB_Exception examples clearly wouldn't be instantiated, anyway: interface DB_Exception_Constraint {} interface DB_Exception_Cannot {} class DB_Exception_Funky implements DB_Exception_Constraint, DB_Exception_Cannot { } This is a pretty rare case, but I can't think of a much more elegant way to solve this using an error code naming system. Hans