Support for property groups in variant elements, in TDFs

This commit is contained in:
Nav
2024-10-12 16:25:11 +01:00
parent 22cca07242
commit 5c896bb2ca
7 changed files with 158 additions and 7 deletions

View File

@@ -1039,6 +1039,17 @@ class ValidationService
. '" - check pinout key';
}
$processedPropertyGroupKeys = [];
foreach ($variant->propertyGroups as $propertyGroup) {
$failures = array_merge($failures, $this->validatePropertyGroup($propertyGroup));
if ($propertyGroup->key !== null && in_array($propertyGroup->key, $processedPropertyGroupKeys)) {
$failures[] = 'Duplicate property group key ("' . $propertyGroup->key . '") detected';
}
$processedPropertyGroupKeys[] = $propertyGroup->key;
}
return array_map(
fn (string $failure): string => 'Variant "' . $variant->name . '" validation failure: ' . $failure,
$failures