public function __call($method, $parameters)
{
if (!isset($this->_callmap[$method])) {
foreach ($this->_delegates as $delegate) {
if (method_exists($delegate, $method)) {
$this->_callmap[$method] = $delegate;
break;
}
}
}
if (!isset($this->_callmap[$method])) {
throw new \BadMethodCallException("No delegates with method '{$method}'");
}
return call_user_func_array(array($this->_callmap[$method], $method), $parameters);
}