/** * Parse embedded objects from a SimpleXml node * and set them to the given object * * @param SimpleXmlElement $xml * @param ClassMetadata $metadata * @param stdClass $obj */ protected function parseEmbeds(\SimpleXmlElement $xml, ClassMetadata $metadata, $obj) { foreach ($metadata->getEmbeds() as $nodeName => $info) { $property = $info[0]; $tempMetaData = $info[1]; $tempXml = $xml->{$nodeName}; $tempObj = $this->parseObject($tempXml, $tempMetaData); $setter = 'set' . ucfirst($property); $obj->{$setter}($tempObj); } }