Skip to content

Commit 0120437

Browse files
author
Alexandr Bashurov
committed
BUGFIX EXTREST-143 Extend already set properties instead of overwriting them
1 parent 4bef1cd commit 0120437

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Api/Client.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,10 @@ private function arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = nul
361361
$el = is_int($key) && $parentEl ? $parentEl : $key;
362362
if (is_array($value)) {
363363
$this->arrayToXml($value, $this->isAssocArray($value) ? $xml->addChild($el) : $xml, $el);
364-
} else {
364+
} elseif(!isset($xml->{$el})) {
365365
$xml->{$el} = (string) $value;
366+
} else {
367+
$xml->{$el}[] = (string) $value;
366368
}
367369
}
368370

0 commit comments

Comments
 (0)