Re: Extending MDB2
| From: | Lukas Smith | Date: | Wed, 21 Apr 2004 21:59:18 +0000 |
| Subject: | Re: Extending MDB2 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28233@lists.php.net to get a copy of this message | ||
Joshua Eichorn wrote:
I'm looking to replace a home grown db abstraction/wrapper with MDB2, however i don't see us porting all the differences in api to mdb2. Especially since in most cases the only difference is setting up a connection, which i've already abstracted away and a couple different helper functions. This of course brings me to my real question, is there an easy way to extend say MDB2_Result_Common to add the helper methods were used to or do I need to hack mdb2 directly (which might be a deal breaker on use it). Any advice that doesn't include me greping through a couple 100K of code would be appreciated.You will have to create a custom result class which is a wrapper around the standard result class. You can define which result class to use in the options array. Then MDB2 will use this result class instead of its own. However you will probably want to create an instance of the MDB2 result class inside your wrapper class ... I think I need to workout the interface a but cleaner (especially the limit support). regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07