if (is_array($callback) && !is_callable($callback) && isset($callback[0])) {
$callback[0] = $this->getComponent($callback[0]);
}
if(!is_callable($callback)) {
throw new Yadif_Exception("No valid callback given for the factory method of '".$origName."'.");
}
$component = call_user_func_array($component[self::CONFIG_FACTORY], $this->injectParameters($constructorArguments, $name));
It should be possible to bind the creation of a Service to a factory method that is located on another component, for example:
This works with the following simple patch:
Index: Yadif/Container.php
--- Yadif/Container.php (revision 28379) +++ Yadif/Container.php (working copy) @@ -432,7 +432,11 @@ $setterMethods = $component[self::CONFIG_METHODS];