src/mg/Ding/Bean/Provider/Yaml.php
public function getBeanDefinition($beanName)
    {
        $beanDef = false;
        if (isset($this->_beanAliases[$beanName])) {
            return $this->getBeanDefinition($this->_beanAliases[$beanName]);
        }
        foreach($this->_yamlFiles as $yamlFilename => $yaml) {
            if (isset($yaml['beans'][$beanName])) {
                $beanDef = $yaml['beans'][$beanName];
                break;
            }
        }
        if (false == $beanDef) {
            return null;
        }
        $bMethods = $bProps = $bAspects = $constructorArgs = array();
        if (isset($beanDef['parent'])) {
            $bean = $this->container->getBeanDefinition($beanDef['parent']);
            $bean = $bean->makeChildBean($beanName);
            $bProps = $bean->getProperties();
            $constructorArgs = $bean->getArguments();
            $bAspects = $bean->getAspects();
            $bMethods = $bean->getMethodInjections();
        } else {
            $bean = clone $this->_templateBeanDef;
        }
        $bean->setName($beanName);
        if (isset($beanDef['class'])) {
            $bean->setClass($beanDef['class']);
        }

        if (isset($beanDef['scope'])) {
            if ($beanDef['scope'] == 'prototype') {
                $bean->setScope(BeanDefinition::BEAN_PROTOTYPE);
            } else if ($beanDef['scope'] == 'singleton') {
                $bean->setScope(BeanDefinition::BEAN_SINGLETON);
            } else {
                throw new BeanFactoryException('Invalid bean scope: ' . $beanDef['scope']);
            }
        }
        if (isset($beanDef['primary'])) {
            $primary = $beanDef['primary'];
            if ($primary == 'true') {
                $bean->markAsPrimaryCandidate();
            }
        }

        if (isset($beanDef['factory-method'])) {
            $bean->setFactoryMethod($beanDef['factory-method']);
        }

        if (isset($beanDef['depends-on'])) {
            $bean->setDependsOn(explode(',', $beanDef['depends-on']));
        }
        if (isset($beanDef['abstract'])) {
            if ($beanDef['abstract'] == 'true') {
                $bean->makeAbstract();
            }
        }
        if (isset($beanDef['factory-bean'])) {
            $bean->setFactoryBean($beanDef['factory-bean']);
        }
        if (isset($beanDef['init-method'])) {
            $bean->setInitMethod($beanDef['init-method']);
        }
        if (isset($beanDef['destroy-method'])) {
            $bean->setDestroyMethod($beanDef['destroy-method']);
        }
        if (isset($beanDef['properties'])) {
            foreach ($beanDef['properties'] as $name => $value) {
                $bProp = $this->_loadProperty($name, $value, $yamlFilename);
                $bProps[$name] = $bProp;
            }
        }
        if (isset($beanDef['constructor-args'])) {
            foreach ($beanDef['constructor-args'] as $name => $arg) {
                $constructorArgs[] = $this->_loadConstructorArg($name, $arg, $yamlFilename);
            }
        }

        if (isset($beanDef['aspects'])) {
            foreach ($beanDef['aspects'] as $name => $aspect) {
                $aspect['id'] = $name;
                $aspectDefinition = $this->_loadAspect($aspect);
                $bAspects[] = $aspectDefinition;
            }
        }

        if (isset($beanDef['lookup-methods'])) {
            foreach ($beanDef['lookup-methods'] as $name => $beanName) {
                $bMethods[] = array($name, $beanName);
            }
        }
        if (!empty($bProps)) {
            $bean->setProperties($bProps);
        }
        if (!empty($bAspects)) {
            $bean->setAspects($bAspects);
        }
        if (!empty($constructorArgs)) {
            $bean->setArguments($constructorArgs);
        }
        if (!empty($bMethods)) {
            $bean->setMethodInjections($bMethods);
        }
        return $bean;
    }
public function getBeanDefinition($beanName)
    {
        $beanDef = false;
        if (isset($this->_beanAliases[$beanName])) {
            return $this->getBeanDefinition($this->_beanAliases[$beanName]);
        }
        foreach($this->_yamlFiles as $yamlFilename => $yaml) {
            if (isset($yaml['beans'][$beanName])) {
                $beanDef = $yaml['beans'][$beanName];
                break;
            }
        }
        if (false == $beanDef) {
            return null;
        }
        $bMethods = $bProps = $bAspects = $constructorArgs = array();
        if (isset($beanDef['parent'])) {
            $bean = $this->container->getBeanDefinition($beanDef['parent']);
            $bean = $bean->makeChildBean($beanName);
            $bProps = $bean->getProperties();
            $constructorArgs = $bean->getArguments();
            $bAspects = $bean->getAspects();
            $bMethods = $bean->getMethodInjections();
        } else {
            $bean = clone $this->_templateBeanDef;
        }
        $bean->setName($beanName);
        if (isset($beanDef['class'])) {
            $bean->setClass($beanDef['class']);
        }

        if (isset($beanDef['scope'])) {
            if ($beanDef['scope'] == 'prototype') {
                $bean->setScope(BeanDefinition::BEAN_PROTOTYPE);
            } else if ($beanDef['scope'] == 'singleton') {
                $bean->setScope(BeanDefinition::BEAN_SINGLETON);
            } else {
                throw new BeanFactoryException('Invalid bean scope: ' . $beanDef['scope']);
            }
        }
        if (isset($beanDef['primary'])) {
            $primary = $beanDef['primary'];
            if ($primary == 'true') {
                $bean->markAsPrimaryCandidate();
            }
        }

        if (isset($beanDef['factory-method'])) {
            $bean->setFactoryMethod($beanDef['factory-method']);
        }

        if (isset($beanDef['depends-on'])) {
            $bean->setDependsOn(explode(',', $beanDef['depends-on']));
        }
        if (isset($beanDef['abstract'])) {
            if ($beanDef['abstract'] == 'true') {
                $bean->makeAbstract();
            }
        }
        if (isset($beanDef['factory-bean'])) {
            $bean->setFactoryBean($beanDef['factory-bean']);
        }
        if (isset($beanDef['init-method'])) {
            $bean->setInitMethod($beanDef['init-method']);
        }
        if (isset($beanDef['destroy-method'])) {
            $bean->setDestroyMethod($beanDef['destroy-method']);
        }
        if (isset($beanDef['properties'])) {
            foreach ($beanDef['properties'] as $name => $value) {
                $bProp = $this->_loadProperty($name, $value, $yamlFilename);
                $bProps[$name] = $bProp;
            }
        }
        if (isset($beanDef['constructor-args'])) {
            foreach ($beanDef['constructor-args'] as $name => $arg) {
                $constructorArgs[] = $this->_loadConstructorArg($name, $arg, $yamlFilename);
            }
        }

        if (isset($beanDef['aspects'])) {
            foreach ($beanDef['aspects'] as $name => $aspect) {
                $aspect['id'] = $name;
                $aspectDefinition = $this->_loadAspect($aspect);
                $bAspects[] = $aspectDefinition;
            }
        }

        if (isset($beanDef['lookup-methods'])) {
            foreach ($beanDef['lookup-methods'] as $name => $beanName) {
                $bMethods[] = array($name, $beanName);
            }
        }
        if (!empty($bProps)) {
            $bean->setProperties($bProps);
        }
        if (!empty($bAspects)) {
            $bean->setAspects($bAspects);
        }
        if (!empty($constructorArgs)) {
            $bean->setArguments($constructorArgs);
        }
        if (!empty($bMethods)) {
            $bean->setMethodInjections($bMethods);
        }
        return $bean;
    }
(non-PHPdoc)
@see Ding\Aspect.IBeanDefinitionProvider::getBeanDefinition()