ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AdditionalMetadataLocation.php
Go to the documentation of this file.
1<?php
2
3namespace SAML2\XML\md;
4
7
14{
20 public $namespace;
21
27 public $location;
28
35 public function __construct(\DOMElement $xml = null)
36 {
37 if ($xml === null) {
38 return;
39 }
40
41 if (!$xml->hasAttribute('namespace')) {
42 throw new \Exception('Missing namespace attribute on AdditionalMetadataLocation element.');
43 }
44 $this->namespace = $xml->getAttribute('namespace');
45
46 $this->location = $xml->textContent;
47 }
48
55 public function toXML(\DOMElement $parent)
56 {
57 assert(is_string($this->namespace));
58 assert(is_string($this->location));
59
60 $e = Utils::addString($parent, Constants::NS_MD, 'md:AdditionalMetadataLocation', $this->location);
61 $e->setAttribute('namespace', $this->namespace);
62
63 return $e;
64 }
65}
An exception for terminatinating execution or to throw for unit testing.
const NS_MD
The namespace for the SAML 2 metadata.
Definition: Constants.php:225
static addString(\DOMElement $parent, $namespace, $name, $value)
Append string element.
Definition: Utils.php:635
__construct(\DOMElement $xml=null)
Initialize an AdditionalMetadataLocation element.
toXML(\DOMElement $parent)
Convert this AdditionalMetadataLocation to XML.
$xml
Definition: metadata.php:240
Interface TriggeredSignal.