src/mg/Ding/Container/Impl/ContainerImpl.php
private function _instantiateByFactoryBean(BeanDefinition $definition)
    {
        $factoryBean = $this->getBean($definition->getFactoryBean());
        $refObject = new \ReflectionObject($factoryBean);
        $factoryMethod = $refObject->getMethod($definition->getFactoryMethod());
        $args = $this->_sortArgsWithNames($definition, $factoryMethod);
        return $factoryMethod->invokeArgs($factoryBean, $args);
    }
private function _instantiateByFactoryBean(BeanDefinition $definition)
    {
        $factoryBean = $this->getBean($definition->getFactoryBean());
        $refObject = new \ReflectionObject($factoryBean);
        $factoryMethod = $refObject->getMethod($definition->getFactoryMethod());
        $args = $this->_sortArgsWithNames($definition, $factoryMethod);
        return $factoryMethod->invokeArgs($factoryBean, $args);
    }
Instantiates a bean using a factory bean.

@param BeanDefinition $definition

@return object