Skip to content

Commit 796ea2c

Browse files
author
Alexandr Bashurov
committed
BUGFIX EXTREST-143 Extend already set properties instead of overwriting them
1 parent f563d54 commit 796ea2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/Api/Client.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,10 @@ protected function _arrayToXml(array $array, SimpleXMLElement $xml, $parentEl =
349349
$el = is_int($key) && $parentEl ? $parentEl : $key;
350350
if (is_array($value)) {
351351
$this->_arrayToXml($value, $this->_isAssocArray($value) ? $xml->addChild($el) : $xml, $el);
352-
} else {
352+
} elseif(!isset($xml->{$el})) {
353353
$xml->{$el} = (string) $value;
354+
} else {
355+
$xml->{$el}[] = (string) $value;
354356
}
355357
}
356358

0 commit comments

Comments
 (0)