private function _instantiate(BeanDefinition $definition)
{
if ($definition->isCreatedByConstructor()) {
return $this->_instantiateByConstructor($definition);
} else {
if ($definition->isCreatedWithFactoryBean()) {
return $this->_instantiateByFactoryBean($definition);
} else {
return $this->_instantiateByFactoryClass($definition);
}
}
}