private function _instantiateByConstructor(BeanDefinition $definition)
    {
        $class = $definition->getClass();
        if ($definition->hasProxyClass()) {
            $class = $definition->getProxyClassName();
        }
        $rClass = $this->_reflectionFactory->getClass($class);
        $factoryMethod = $rClass->getConstructor();
        if ($factoryMethod !== null) {
            $args = $this->_sortArgsWithNames($definition, $factoryMethod);
            if (empty($args)) {
                return $rClass->newInstanceArgs();
            } else {
                return $rClass->newInstanceArgs($args);
            }
        } else {
            return $rClass->newInstanceArgs();
        }
    }
private function _instantiateByConstructor(BeanDefinition $definition)
    {
        $class = $definition->getClass();
        if ($definition->hasProxyClass()) {
            $class = $definition->getProxyClassName();
        }
        $rClass = $this->_reflectionFactory->getClass($class);
        $factoryMethod = $rClass->getConstructor();
        if ($factoryMethod !== null) {
            $args = $this->_sortArgsWithNames($definition, $factoryMethod);
            if (empty($args)) {
                return $rClass->newInstanceArgs();
            } else {
                return $rClass->newInstanceArgs($args);
            }
        } else {
            return $rClass->newInstanceArgs();
        }
    }
private function _instantiateByConstructor ( BeanDefinition $ definition ) { $ class = $ definition -> getClass ( ) ; if ( $ definition -> hasProxyClass ( ) ) { $ class = $ definition -> getProxyClassName ( ) ; } $ rClass = $ this -> _reflectionFactory -> getClass ( $ class ) ; $ factoryMethod = $ rClass -> getConstructor ( ) ; if ( $ factoryMethod !== null ) { $ args = $ this -> _sortArgsWithNames ( $ definition , $ factoryMethod ) ; if ( empty ( $ args ) ) { return $ rClass -> newInstanceArgs ( ) ; } else { return $ rClass -> newInstanceArgs ( $ args ) ; } } else { return $ rClass -> newInstanceArgs ( ) ; } }
Instantiates a bean using the constructor.

@param BeanDefinition $definition

@return object
Instantiates a bean using the constructor .