private function getStructuredDataNode($xml_element, $type, $identifier) { if (self::DEBUG) { u\DebugUtility::out("{$type}, {$identifier}"); } $obj = AssetTemplate::getStructuredDataNode(); if ($type == c\T::GROUP) { $obj->type = $type; $obj->identifier = $identifier; $obj->structuredDataNodes = new \stdClass(); $child_count = count($xml_element->children()); $more_than_one = $child_count > 1 ? true : false; if ($more_than_one) { $obj->structuredDataNodes->structuredDataNode = array(); foreach ($xml_element->children() as $child) { $child_type = $child->getName(); if (self::DEBUG) { u\DebugUtility::out("Child type in group: {$child_type}"); } if (isset($child[c\T::IDENTIFIER])) { $child_identifier = $child[c\T::IDENTIFIER]->__toString(); $child_std = $this->createChildStd($child, $child_type, $child_identifier); $obj->structuredDataNodes->structuredDataNode[] = $child_std; } } } else { $xml_array = $xml_element->children(); //var_dump( $xml_array ); $child = $xml_array[0]; $child_type = $child->getName(); if (self::DEBUG) { u\DebugUtility::out("Child type in group: {$child_type}"); } $child_identifier = $child[c\T::IDENTIFIER]->__toString(); $child_std = $this->createChildStd($child, $child_type, $child_identifier); $obj->structuredDataNodes->structuredDataNode = $child_std; } } else { $obj->type = $type; $obj->identifier = $identifier; } return $obj; }