Hi Sebastian
Apologies for the random email, I wonder if you can take a look at a PHP5 aggregation issue I've run into.
I've modified your aggregation/delegate example[1] trying to get it to work as there appear to have been API changes since that was written.
Getting the method of the delegate object and invoking it seems fine, however it doesn't seem to be able to interpret params. When my delegated object's method is invoked, the $parameters arg appears to be ignored, although it correctly exists as an array of args when it gets to __call().
I've tried various formats for the args to invoke(), but can't get it to work - any ideas?
I've modified the __call method of my class to look like this:
function __call($methodName, $parameters)
{
$delegated = false;
foreach ($this->aDelegates as $delegate) {
$method = new ReflectionMethod(get_class($delegate), $methodName);
$delegated = true;
return $method->invoke($delegate, $parameters);
}
if (!$delegated) {
PEAR::raiseError('Problem aggregating object', SGL_ERROR_INVALIDCALL, PEAR_ERROR_DIE);
}
}
function addDelegate($delegate) { $this->aDelegates[] = $delegate; }
Am running - winXP - PHP 5.02 - apache 2.052
thanks in advance,
Demian Turner
[1] http://www.zend.com/zend/php5/php5-delegation.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php