src/mg/Ding/Bean/Provider/Yaml.php
private function _loadAspect($aspect)
    {
        $aspects = array();
        if (isset($aspect['id'])) {
            $name = $aspect['id'];
        } else {
            $name = BeanDefinition::generateName('AspectYAML');
        }
        if (isset($aspect['expression'])) {
            $expression = $aspect['expression'];
        } else {
            $expression = '';
        }
        $aspectBean = $aspect['ref'];
        $type = $aspect['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 ($aspect['pointcuts'] as $pointcut) {
            if (isset($pointcut['id'])) {
                $pointcutName = $pointcut['id'];
            } else {
                $pointcutName = BeanDefinition::generateName('PointcutYAML');
            }
            if (isset($pointcut['expression'])) {
                $pointcutDef = clone $this->_templatePointcutDef;
                $pointcutDef->setName($pointcutName);
                $pointcutDef->setExpression($pointcut['expression']);
                $pointcutDef->setMethod($pointcut['method']);
                $this->_aspectManager->setPointcut($pointcutDef);
                $pointcuts[] = $pointcutName;
            } else if (isset($pointcut['pointcut-ref'])) {
                $pointcuts[] = $pointcut['pointcut-ref'];
            }
        }
        return new AspectDefinition($name, $pointcuts, $type, $aspectBean, $expression);
    }
private function _loadAspect($aspect)
    {
        $aspects = array();
        if (isset($aspect['id'])) {
            $name = $aspect['id'];
        } else {
            $name = BeanDefinition::generateName('AspectYAML');
        }
        if (isset($aspect['expression'])) {
            $expression = $aspect['expression'];
        } else {
            $expression = '';
        }
        $aspectBean = $aspect['ref'];
        $type = $aspect['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 ($aspect['pointcuts'] as $pointcut) {
            if (isset($pointcut['id'])) {
                $pointcutName = $pointcut['id'];
            } else {
                $pointcutName = BeanDefinition::generateName('PointcutYAML');
            }
            if (isset($pointcut['expression'])) {
                $pointcutDef = clone $this->_templatePointcutDef;
                $pointcutDef->setName($pointcutName);
                $pointcutDef->setExpression($pointcut['expression']);
                $pointcutDef->setMethod($pointcut['method']);
                $this->_aspectManager->setPointcut($pointcutDef);
                $pointcuts[] = $pointcutName;
            } else if (isset($pointcut['pointcut-ref'])) {
                $pointcuts[] = $pointcut['pointcut-ref'];
            }
        }
        return new AspectDefinition($name, $pointcuts, $type, $aspectBean, $expression);
    }
Returns an aspect definition.

@param mixed[] $aspect Aspect data.

@throws BeanFactoryException
@return AspectDefinition