Re: Extending MDB2

From: Date: Wed, 21 Apr 2004 22:25:35 +0000
Subject: Re: Extending MDB2
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-28235@lists.php.net to get a copy of this message
Lukas Smith wrote:
Lukas Smith wrote:
Joshua Eichorn wrote:
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).
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
That could be handy, i think in my case just the result class will be enough but i won't know until i get a bit farther into the port. -josh
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


« previous php.pear.dev (#28235) next »