Skip to content
Snippets Groups Projects

feat: allow update map attr typ

Merged Pavel Vyskočil requested to merge fix_updateUes into main
1 file
+ 13
6
Compare changes
  • Side-by-side
  • Inline
+ 13
6
@@ -154,18 +154,25 @@ class UESUpdateHelper
@@ -154,18 +154,25 @@ class UESUpdateHelper
(self::isComplexType($attribute[self::TYPE]) ||
(self::isComplexType($attribute[self::TYPE]) ||
in_array($attrName, $serializedAttributes, true))
in_array($attrName, $serializedAttributes, true))
) {
) {
$attr = in_array($attrName, $serializedAttributes, true) ?
if (
array_merge($attr, explode(';', $attribute[self::VALUE])) :
strpos($attribute[self::TYPE], self::MAP_TYPE) ||
array_merge($attr, $attribute[self::VALUE]);
!in_array($attrName, $serializedAttributes, true)
 
) {
 
$attr = array_merge($attr, $attribute[self::VALUE]);
 
} else {
 
$attr = array_merge($attr, explode(';', $attribute[self::VALUE]));
 
}
}
}
if (self::isSimpleType($attribute[self::TYPE])) {
if (self::isSimpleType($attribute[self::TYPE])) {
$newValue = self::convertToString($attr);
$newValue = self::convertToString($attr);
} elseif (self::isComplexType($attribute[self::TYPE])) {
} elseif (self::isComplexType($attribute[self::TYPE])) {
if (!empty($attr)) {
if (empty($attr)) {
$newValue = array_values(array_unique($attr));
} else {
$newValue = [];
$newValue = [];
 
} elseif (strpos($attribute[self::TYPE], self::MAP_TYPE)) {
 
$newValue = $attr;
 
} else {
 
$newValue = array_values(array_unique($attr));
}
}
if (in_array($attrName, $serializedAttributes, true)) {
if (in_array($attrName, $serializedAttributes, true)) {
$newValue = self::convertToString($newValue);
$newValue = self::convertToString($newValue);
Loading