src/mg/Ding/Bean/Provider/Xml.php
private function _loadAspect($simpleXmlAspect)
    {
        $aspects = array();
        $atts = $simpleXmlAspect->attributes();
        if (isset($atts->id)) {
            $name = (string)$atts->id;
        } else {
            $name = BeanDefinition::generateName('AspectXML');
        }
        if (isset($atts->expression)) {
            $expression = (string)$atts->expression;
        } else {
            $expression = '';
        }
        $aspectBean = (string)$atts->ref;
        $type = (string)$atts->type;
        if ($type == 'method') {
            $type = AspectDefinition::ASPECT_METHOD;
        } else if ($type == 'exception') {
            $type = AspectDefinition::ASPECT_EXCEPTION;
        } else {
            throw new BeanFactoryException('Invalid aspect type');
        }
        $pointcuts = array();
        foreach ($simpleXmlAspect->pointcut as $pointcut) {
            $pointcutAtts = $pointcut->attributes();
            if (isset($pointcutAtts->id)) {
                $pointcutName = (string)$pointcutAtts->id;
            } else {
                $pointcutName = BeanDefinition::generateName('PointcutXML');
            }
            if (isset($pointcutAtts->expression)) {
                $pointcut = clone $this->_templatePointcutDef;
                $pointcut->setName($pointcutName);
                $pointcut->setExpression((string)$pointcutAtts->expression);
                $pointcut->setMethod((string)$pointcutAtts->method);
                $this->_aspectManager->setPointcut($pointcut);
                $pointcuts[] = $pointcutName;
            } else if (isset($pointcutAtts->{'pointcut-ref'})) {
                $pointcuts[] = (string)$pointcutAtts->{'pointcut-ref'};
            }
        }
        $aspect = new AspectDefinition($name, $pointcuts, $type, $aspectBean, $expression);
        return $aspect;
    }
private function _loadAspect($simpleXmlAspect)
    {
        $aspects = array();
        $atts = $simpleXmlAspect->attributes();
        if (isset($atts->id)) {
            $name = (string)$atts->id;
        } else {
            $name = BeanDefinition::generateName('AspectXML');
        }
        if (isset($atts->expression)) {
            $expression = (string)$atts->expression;
        } else {
            $expression = '';
        }
        $aspectBean = (string)$atts->ref;
        $type = (string)$atts->type;
        if ($type == 'method') {
            $type = AspectDefinition::ASPECT_METHOD;
        } else if ($type == 'exception') {
            $type = AspectDefinition::ASPECT_EXCEPTION;
        } else {
            throw new BeanFactoryException('Invalid aspect type');
        }
        $pointcuts = array();
        foreach ($simpleXmlAspect->pointcut as $pointcut) {
            $pointcutAtts = $pointcut->attributes();
            if (isset($pointcutAtts->id)) {
                $pointcutName = (string)$pointcutAtts->id;
            } else {
                $pointcutName = BeanDefinition::generateName('PointcutXML');
            }
            if (isset($pointcutAtts->expression)) {
                $pointcut = clone $this->_templatePointcutDef;
                $pointcut->setName($pointcutName);
                $pointcut->setExpression((string)$pointcutAtts->expression);
                $pointcut->setMethod((string)$pointcutAtts->method);
                $this->_aspectManager->setPointcut($pointcut);
                $pointcuts[] = $pointcutName;
            } else if (isset($pointcutAtts->{'pointcut-ref'})) {
                $pointcuts[] = (string)$pointcutAtts->{'pointcut-ref'};
            }
        }
        $aspect = new AspectDefinition($name, $pointcuts, $type, $aspectBean, $expression);
        return $aspect;
    }
Returns an aspect definition.

@param SimpleXML $simpleXmlAspect Aspect node.

@throws BeanFactoryException
@return AspectDefinition