public function getBean($name)
    {
        $ret = false;
        $beanDefinition = $this->getBeanDefinition($name);
        $beanName = $name . '.bean';
        if ($beanDefinition->isAbstract()) {
            throw new BeanFactoryException(
            	"Cant instantiate abstract bean: $name"
            );
        }
        if ($beanDefinition->isPrototype()) {
            $ret = $this->_createBean($beanDefinition);
        } else if ($beanDefinition->isSingleton()) {
            if (isset($this->_beans[$beanName])) {
                $ret = $this->_beans[$beanName];
            } else {
                $ret = $this->_beanCache->fetch($beanName, $result);
                if (!$ret) {
                    $ret = $this->_createBean($beanDefinition);
                }
                $this->_beans[$beanName] = $ret;
            }
        }
        return $ret;
    }
public function getBean($name)
    {
        $ret = false;
        $beanDefinition = $this->getBeanDefinition($name);
        $beanName = $name . '.bean';
        if ($beanDefinition->isAbstract()) {
            throw new BeanFactoryException(
            	"Cant instantiate abstract bean: $name"
            );
        }
        if ($beanDefinition->isPrototype()) {
            $ret = $this->_createBean($beanDefinition);
        } else if ($beanDefinition->isSingleton()) {
            if (isset($this->_beans[$beanName])) {
                $ret = $this->_beans[$beanName];
            } else {
                $ret = $this->_beanCache->fetch($beanName, $result);
                if (!$ret) {
                    $ret = $this->_createBean($beanDefinition);
                }
                $this->_beans[$beanName] = $ret;
            }
        }
        return $ret;
    }
public function getBean ( $ name ) { $ ret = false ; $ beanDefinition = $ this -> getBeanDefinition ( $ name ) ; $ beanName = $ name . '.bean' ; if ( $ beanDefinition -> isAbstract ( ) ) { throw new BeanFactoryException ( "Cant instantiate abstract bean: $name" ) ; } if ( $ beanDefinition -> isPrototype ( ) ) { $ ret = $ this -> _createBean ( $ beanDefinition ) ; } else if ( $ beanDefinition -> isSingleton ( ) ) { if ( isset ( $ this -> _beans [ $ beanName ] ) ) { $ ret = $ this -> _beans [ $ beanName ] ; } else { $ ret = $ this -> _beanCache -> fetch ( $ beanName , $ result ) ; if ( ! $ ret ) { $ ret = $ this -> _createBean ( $ beanDefinition ) ; } $ this -> _beans [ $ beanName ] = $ ret ; } } return $ ret ; }
Returns a bean.

@param string $name Bean name.

@throws BeanFactoryException
@return object
Returns a bean .