ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\XML\mdui\DiscoHints Class Reference
+ Collaboration diagram for SAML2\XML\mdui\DiscoHints:

Public Member Functions

 __construct (\DOMElement $xml=null)
 Create a DiscoHints element. More...
 
 toXML (\DOMElement $parent)
 Convert this DiscoHints to XML. More...
 

Data Fields

 $children = array()
 
 $IPHint = array()
 
 $DomainHint = array()
 
 $GeolocationHint = array()
 

Detailed Description

Definition at line 14 of file DiscoHints.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\XML\mdui\DiscoHints::__construct ( \DOMElement  $xml = null)

Create a DiscoHints element.

Parameters
\DOMElement | null$xmlThe XML element we should load.

Definition at line 51 of file DiscoHints.php.

References $xml, SAML2\Utils\extractStrings(), SAML2\XML\mdui\Common\NS, and SAML2\Utils\xpQuery().

52  {
53  if ($xml === null) {
54  return;
55  }
56 
57  $this->IPHint = Utils::extractStrings($xml, Common::NS, 'IPHint');
58  $this->DomainHint = Utils::extractStrings($xml, Common::NS, 'DomainHint');
59  $this->GeolocationHint = Utils::extractStrings($xml, Common::NS, 'GeolocationHint');
60 
61  foreach (Utils::xpQuery($xml, "./*[namespace-uri()!='".Common::NS."']") as $node) {
62  $this->children[] = new Chunk($node);
63  }
64  }
static extractStrings(\DOMElement $parent, $namespaceURI, $localName)
Extract strings from a set of nodes.
Definition: Utils.php:610
$xml
Definition: metadata.php:240
static xpQuery(\DOMNode $node, $query)
Do an XPath query on an XML node.
Definition: Utils.php:191
+ Here is the call graph for this function:

Member Function Documentation

◆ toXML()

SAML2\XML\mdui\DiscoHints::toXML ( \DOMElement  $parent)

Convert this DiscoHints to XML.

Parameters
\DOMElement$parentThe element we should append to.
Returns
|null

Definition at line 72 of file DiscoHints.php.

References SAML2\Utils\addStrings(), and SAML2\XML\mdui\Common\NS.

73  {
74  assert(is_array($this->IPHint));
75  assert(is_array($this->DomainHint));
76  assert(is_array($this->GeolocationHint));
77  assert(is_array($this->children));
78 
79  if (!empty($this->IPHint)
80  || !empty($this->DomainHint)
81  || !empty($this->GeolocationHint)
82  || !empty($this->children)) {
83  $doc = $parent->ownerDocument;
84 
85  $e = $doc->createElementNS(Common::NS, 'mdui:DiscoHints');
86  $parent->appendChild($e);
87 
88  if (!empty($this->children)) {
89  foreach ($this->children as $child) {
90  $child->toXML($e);
91  }
92  }
93 
94  Utils::addStrings($e, Common::NS, 'mdui:IPHint', false, $this->IPHint);
95  Utils::addStrings($e, Common::NS, 'mdui:DomainHint', false, $this->DomainHint);
96  Utils::addStrings($e, Common::NS, 'mdui:GeolocationHint', false, $this->GeolocationHint);
97 
98  return $e;
99  }
100 
101  return null;
102  }
static addStrings(\DOMElement $parent, $namespace, $name, $localized, array $values)
Append string elements.
Definition: Utils.php:659
+ Here is the call graph for this function:

Field Documentation

◆ $children

SAML2\XML\mdui\DiscoHints::$children = array()

Definition at line 23 of file DiscoHints.php.

◆ $DomainHint

SAML2\XML\mdui\DiscoHints::$DomainHint = array()

Definition at line 37 of file DiscoHints.php.

◆ $GeolocationHint

SAML2\XML\mdui\DiscoHints::$GeolocationHint = array()

Definition at line 44 of file DiscoHints.php.

◆ $IPHint

SAML2\XML\mdui\DiscoHints::$IPHint = array()

Definition at line 30 of file DiscoHints.php.


The documentation for this class was generated from the following file: