Re: Extending MDB2
| From: | Lukas Smith | Date: | Wed, 21 Apr 2004 22:21:47 +0000 |
| Subject: | Re: Extending MDB2 | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28234@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Joshua Eichorn wrote:Hmm actually thinking about it I should probably directly support wrapping by allowing people to define a wrapper class aside from the result class. Hmmmmm 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 07This 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).