src/mg/Ding/Bean/Provider/Xml.php
private function _loadProperty($simpleXmlProperty)
    {
        $propName = (string)$simpleXmlProperty->attributes()->name;
        if (isset($simpleXmlProperty->ref)) {
            $propType = BeanPropertyDefinition::PROPERTY_BEAN;
            $propValue = (string)$simpleXmlProperty->ref->attributes()->bean;
        } else if (isset($simpleXmlProperty->null)) {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = null;
        } else if (isset($simpleXmlProperty->false)) {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = false;
        } else if (isset($simpleXmlProperty->true)) {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = true;
        } else if (isset($simpleXmlProperty->bean)) {
            $propType = BeanPropertyDefinition::PROPERTY_BEAN;
            $name = BeanDefinition::generateName('Bean');
            $simpleXmlProperty->bean->addAttribute('id', $name);
            $propValue = $name;
        } else if (isset($simpleXmlProperty->array)) {
            $propType = BeanPropertyDefinition::PROPERTY_ARRAY;
            $propValue = array();
            foreach ($simpleXmlProperty->array->entry as $arrayEntry) {
                if (isset($arrayEntry->attributes()->key)) {
                    $key = (string)$arrayEntry->attributes()->key;
                    $propValue[$key] = $this->_loadProperty($arrayEntry);
                } else {
                    $propValue[] = $this->_loadProperty($arrayEntry);
                }
            }
        } else if (isset($simpleXmlProperty->eval)) {
            $propType = BeanPropertyDefinition::PROPERTY_CODE;
            $propValue = (string)$simpleXmlProperty->eval;
        } else {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = (string)$simpleXmlProperty->value;
        }
        return new BeanPropertyDefinition($propName, $propType, $propValue);
    }
private function _loadProperty($simpleXmlProperty)
    {
        $propName = (string)$simpleXmlProperty->attributes()->name;
        if (isset($simpleXmlProperty->ref)) {
            $propType = BeanPropertyDefinition::PROPERTY_BEAN;
            $propValue = (string)$simpleXmlProperty->ref->attributes()->bean;
        } else if (isset($simpleXmlProperty->null)) {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = null;
        } else if (isset($simpleXmlProperty->false)) {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = false;
        } else if (isset($simpleXmlProperty->true)) {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = true;
        } else if (isset($simpleXmlProperty->bean)) {
            $propType = BeanPropertyDefinition::PROPERTY_BEAN;
            $name = BeanDefinition::generateName('Bean');
            $simpleXmlProperty->bean->addAttribute('id', $name);
            $propValue = $name;
        } else if (isset($simpleXmlProperty->array)) {
            $propType = BeanPropertyDefinition::PROPERTY_ARRAY;
            $propValue = array();
            foreach ($simpleXmlProperty->array->entry as $arrayEntry) {
                if (isset($arrayEntry->attributes()->key)) {
                    $key = (string)$arrayEntry->attributes()->key;
                    $propValue[$key] = $this->_loadProperty($arrayEntry);
                } else {
                    $propValue[] = $this->_loadProperty($arrayEntry);
                }
            }
        } else if (isset($simpleXmlProperty->eval)) {
            $propType = BeanPropertyDefinition::PROPERTY_CODE;
            $propValue = (string)$simpleXmlProperty->eval;
        } else {
            $propType = BeanPropertyDefinition::PROPERTY_SIMPLE;
            $propValue = (string)$simpleXmlProperty->value;
        }
        return new BeanPropertyDefinition($propName, $propType, $propValue);
    }
Returns a property definition.

@param SimpleXML $simpleXmlProperty Property node.

@throws BeanFactoryException
@return BeanPropertyDefinition