Check if key # is defined in $value
If # is undefined in $value use set the attribute value as $value
This commit is contained in:
parent
3caa32edc8
commit
eac14b5ef2
@ -240,7 +240,11 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
|
||||
|
||||
if ($key === 'item') {
|
||||
if (isset($value['@key'])) {
|
||||
if (isset($value['#'])) {
|
||||
$data[(string) $value['@key']] = $value['#'];
|
||||
} else {
|
||||
$data[(string) $value['@key']] = $value;
|
||||
}
|
||||
} else {
|
||||
$data['item'][] = $value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user