ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Chunk.php
Go to the documentation of this file.
1<?php
2
3namespace SAML2\XML;
4
7
13class Chunk implements \Serializable
14{
20 public $localName;
21
28
34 public $xml;
35
41 public function __construct(\DOMElement $xml)
42 {
43 $this->localName = $xml->localName;
44 $this->namespaceURI = $xml->namespaceURI;
45
46 $this->xml = Utils::copyElement($xml);
47 }
48
55 public function getXML()
56 {
57 return $this->xml;
58 }
59
66 public function toXML(\DOMElement $parent)
67 {
68 return Utils::copyElement($this->xml, $parent);
69 }
70
76 public function serialize()
77 {
78 return serialize($this->xml->ownerDocument->saveXML($this->xml));
79 }
80
86 public function unserialize($serialized)
87 {
89 $this->xml = $doc->documentElement;
90 $this->localName = $this->xml->localName;
91 $this->namespaceURI = $this->xml->namespaceURI;
92 }
93}
An exception for terminatinating execution or to throw for unit testing.
unserialize($serialized)
Un-serialize this XML chunk.
Definition: Chunk.php:86
toXML(\DOMElement $parent)
Append this XML element to a different XML element.
Definition: Chunk.php:66
__construct(\DOMElement $xml)
Create a XMLChunk from a copy of the given \DOMElement.
Definition: Chunk.php:41
getXML()
Get this \DOMElement.
Definition: Chunk.php:55
serialize()
Serialize this XML chunk.
Definition: Chunk.php:76