Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | public function xmlSerialize(SimpleXMLElement $xmlRoot = null) |
||
43 | { |
||
44 | $xmlString = $this->getSerializer()->serialize($this, 'xml'); |
||
45 | $xmlObject = new SimpleXMLElement($xmlString); |
||
46 | |||
47 | if ($xmlRoot === null) { |
||
48 | return $xmlObject; |
||
49 | } |
||
50 | |||
51 | $domRoot = dom_import_simplexml($xmlRoot); |
||
52 | $domObject = dom_import_simplexml($xmlObject); |
||
53 | |||
54 | $domRoot->appendChild($domRoot->ownerDocument->importNode($domObject, true)); |
||
55 | |||
56 | return $xmlRoot; |
||
57 | } |
||
58 | |||
68 |