Fixes #53, ordering of XML::toArray() operations.

This commit is contained in:
predominant 2010-03-26 19:59:09 +11:00
parent 9f5949ab52
commit ec3f4b8d34
2 changed files with 39 additions and 1 deletions

View file

@ -664,6 +664,7 @@ class XmlNode extends Object {
foreach ($this->children as $child) {
$key = $camelize ? Inflector::camelize($child->name) : $child->name;
//debug($key);
if (is_a($child, 'XmlTextNode')) {
$out['value'] = $child->value;
@ -688,7 +689,7 @@ class XmlNode extends Object {
if (isset($out[$key]) || isset($multi[$key])) {
if (!isset($multi[$key])) {
$multi[$key] = array($out[$key]);
unset($out[$key]);
//unset($out[$key]);
}
$multi[$key][] = $value;
} elseif (!empty($value)) {