@@ -1096,7 +1096,7 @@ private function generateXmlDirectly(array $objects, array $schemaIdMap): string
10961096 folder: $ sectionFolder ,
10971097 object: $ object ,
10981098 sectionName: $ sectionName ,
1099- propertyDefinitionMap: $ propertyDefinitionMap
1099+ propertyDefinitionMap: $ propDefMap
11001100 );
11011101 }
11021102
@@ -1186,7 +1186,7 @@ private function addObjectDirectlyToXmlWithProperties(
11861186 $ xmlData = $ object ['xml ' ];
11871187 unset($ xmlData ['_essential_data ' ]);
11881188 } else {
1189- $ xmlData = $ this ->cleanObjectDataForXml (object: $ object , propDefMap: $ propDefMap );
1189+ $ xmlData = $ this ->cleanObjectDataForXml (object: $ object , propDefMap: $ propertyDefinitionMap );
11901190 }
11911191
11921192 if (is_array ($ xmlData ) === true && empty ($ xmlData ) === false ) {
@@ -1498,8 +1498,8 @@ private function formatXmlOutput(string $xmlString): string
14981498 /**
14991499 * Clean object data for XML export.
15001500 *
1501- * @param array $object The object data to clean.
1502- * @param array $propertyDefinitionMap Property definition map.
1501+ * @param array $object The object data to clean.
1502+ * @param array $propDefMap Property definition map.
15031503 *
15041504 * @return array The cleaned object data.
15051505 */
@@ -1652,17 +1652,17 @@ private function addCleanDataToXmlNode(
16521652 }
16531653
16541654 // Add properties from root fields using propertyDefinitionMap ONLY if no properties were already processed.
1655- if (empty ($ propDefMap ) === false && isset ($ data ['properties ' ]) === false ) {
1656- $ this ->addPropertiesFromRootFields (node: $ node , object: $ data , propDefMap: $ propDefMap );
1655+ if (empty ($ propertyDefinitionMap ) === false && isset ($ data ['properties ' ]) === false ) {
1656+ $ this ->addPropertiesFromRootFields (node: $ node , object: $ data , propDefMap: $ propertyDefinitionMap );
16571657 }
16581658 }//end addCleanDataToXmlNode()
16591659
16601660 /**
16611661 * Add properties to XML node using propertyDefinitionMap from model.
16621662 *
1663- * @param \SimpleXMLElement $node XML node to add properties to.
1664- * @param array $object The object with root-level properties.
1665- * @param array $propertyDefinitionMap Map of property name to ref.
1663+ * @param \SimpleXMLElement $node XML node to add properties to.
1664+ * @param array $object The object with root-level properties.
1665+ * @param array $propDefMap Map of property name to ref.
16661666 *
16671667 * @return void
16681668 */
@@ -2281,7 +2281,8 @@ private function validatePropertiesAreNotEmpty(\SimpleXMLElement $xml): void
22812281 throw new \InvalidArgumentException ("Property missing value element: $ propRef " );
22822282 }
22832283
2284- $ value = trim ((string ) $ valueElements [0 ]);
2284+ $ value = trim ((string ) $ valueElements [0 ]);
2285+ $ propRef = (string ) $ attributes ['propertyDefinitionRef ' ];
22852286 if (empty ($ value ) === true ) {
22862287 throw new \InvalidArgumentException ("Property has empty value: $ propRef " );
22872288 }
@@ -3195,7 +3196,7 @@ private function assembleOrganizationXml(
31953196 folder: $ elementsFolder ,
31963197 object: $ obj ,
31973198 sectionName: 'elements ' ,
3198- propertyDefinitionMap: $ propertyDefinitionMap
3199+ propertyDefinitionMap: $ propDefMap
31993200 );
32003201 }
32013202 }
@@ -3228,7 +3229,7 @@ private function assembleOrganizationXml(
32283229 folder: $ relsFolder ,
32293230 object: $ obj ,
32303231 sectionName: 'relationships ' ,
3231- propertyDefinitionMap: $ propertyDefinitionMap
3232+ propertyDefinitionMap: $ propDefMap
32323233 );
32333234 }
32343235 }
@@ -3260,7 +3261,7 @@ private function assembleOrganizationXml(
32603261 folder: $ propDefsFolder ,
32613262 object: $ obj ,
32623263 sectionName: 'property_definitions ' ,
3263- propertyDefinitionMap: $ propertyDefinitionMap
3264+ propertyDefinitionMap: $ propDefMap
32643265 );
32653266 }
32663267 }
@@ -3334,7 +3335,7 @@ private function assembleOrganizationXml(
33343335 folder: $ diagramsFolder ,
33353336 object: $ obj ,
33363337 sectionName: 'views ' ,
3337- propertyDefinitionMap: $ propertyDefinitionMap
3338+ propertyDefinitionMap: $ propDefMap
33383339 );
33393340 }
33403341 }
0 commit comments