src/mg/Ding/Bean/Provider/Annotation.php
private function _addBean($class, $key, $annotations, $overrideWithName = false, $fBean = false, $fMethod = false)
    {
        $annotation = $annotations->getSingleAnnotation($key);
        $names = $this->_getAllNames($annotation, $overrideWithName);
        $leadName = $names[0];
        $this->_addBeanToKnownByClass($class, $leadName);
        $this->_knownBeans[$leadName] = array($names, $class, $key, $annotations, $fBean, $fMethod);

        // Dont let @Bean methods interfere with bean parentship.
        if (!$fBean) {
            $this->_knownClassesWithValidBeanAnnotations[$class] = $leadName;
        }
        return $leadName;
    }
private function _addBean($class, $key, $annotations, $overrideWithName = false, $fBean = false, $fMethod = false)
    {
        $annotation = $annotations->getSingleAnnotation($key);
        $names = $this->_getAllNames($annotation, $overrideWithName);
        $leadName = $names[0];
        $this->_addBeanToKnownByClass($class, $leadName);
        $this->_knownBeans[$leadName] = array($names, $class, $key, $annotations, $fBean, $fMethod);

        // Dont let @Bean methods interfere with bean parentship.
        if (!$fBean) {
            $this->_knownClassesWithValidBeanAnnotations[$class] = $leadName;
        }
        return $leadName;
    }
Adds a bean to $_knownBeans.

@param string $class The class for this bean
@param string $key Where this bean has been chosen from (i.e: component, configuration, bean, etc)
@param Ding\Annotation\Collection $annotations Annotations for this bean
@param string $overrideWithName Override this bean name with this one
@param string $fBean An optional factory bean
@param string $fMethod An optional factory method

@return string The name of the bean recently added