Made property-group elements optional in TDFs

This commit is contained in:
Nav
2024-10-12 16:04:55 +01:00
parent 8b5f626e4f
commit 22cca07242

View File

@@ -159,9 +159,11 @@ class XmlService
$deviceElement->setAttribute($attrName, $attrValue); $deviceElement->setAttribute($attrName, $attrValue);
} }
$propertyGroupsElement = $document->createElement('property-groups'); if (!empty($tdf->propertyGroups)) {
foreach ($tdf->propertyGroups as $propertyGroup) { $propertyGroupsElement = $document->createElement('property-groups');
$propertyGroupsElement->append($this->toXmlService->propertyGroupToXml($propertyGroup, $document)); foreach ($tdf->propertyGroups as $propertyGroup) {
$propertyGroupsElement->append($this->toXmlService->propertyGroupToXml($propertyGroup, $document));
}
} }
$deviceElement->append($propertyGroupsElement); $deviceElement->append($propertyGroupsElement);