Very inventive! I like this solution. Though it would make most sense
if I were doing this for each function in the class.
In this case, I am, so I think I might use your solution :) thanks!
Phil
Sent from my iPhone
On 12/09/2008, at 5:11 PM, "Rory Casey" <[EMAIL PROTECTED]> wrote:
>
> If you're in a class you could use __call to override all your
> methods:
>
> class Wrapper
> {
> public function __call($method, $args=array())
> {
> // figure out if any of $args needs to be
> // created - possibly do this via reflection
>
> $privateMethod = '_' . $method;
>
> return $this->$privateMethod($args[0], ...);
>
> }
>
> private function _doSomething(Class $class)
> {
>
> }
> }
>
> Seems like overkill unless you were going to have lots of methods
> where you want to do this.
>
> Rory
>
> >
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---