ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Chunk.php
Go to the documentation of this file.
1 <?php
2 
3 namespace SAML2\XML;
4 
6 use SAML2\Utils;
7 
13 class Chunk implements \Serializable
14 {
20  public $localName;
21 
27  public $namespaceURI;
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  {
88  $doc = DOMDocumentFactory::fromString(unserialize($serialized));
89  $this->xml = $doc->documentElement;
90  $this->localName = $this->xml->localName;
91  $this->namespaceURI = $this->xml->namespaceURI;
92  }
93 }
getXML()
Get this .
Definition: Chunk.php:55
unserialize($serialized)
Un-serialize this XML chunk.
Definition: Chunk.php:86
serialize()
Serialize this XML chunk.
Definition: Chunk.php:76
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 .
Definition: Chunk.php:41