private function addChildData(&$parentData, $childAttributes)
{
$authorizedChildAttributes = $parentData['children_attributes'];
$addedChildAttributesData = array_filter($childAttributes, function ($attributeCode) use($authorizedChildAttributes) {
return in_array($attributeCode, $authorizedChildAttributes);
}, ARRAY_FILTER_USE_KEY);
foreach ($addedChildAttributesData as $attributeCode => $value) {
if (!isset($parentData[$attributeCode])) {
$parentData[$attributeCode] = [];
}
$parentData[$attributeCode] = array_unique(array_merge($parentData[$attributeCode], $value));
}
}