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

Public Member Functions

 __construct (\DOMElement $xml=null)
 Create/parse a mdrpi:RegistrationInfo element. More...
 
 toXML (\DOMElement $parent)
 Convert this element to XML. More...
 

Data Fields

 $registrationAuthority
 
 $registrationInstant
 
 $RegistrationPolicy = array()
 

Detailed Description

Definition at line 13 of file RegistrationInfo.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\XML\mdrpi\RegistrationInfo::__construct ( \DOMElement  $xml = null)

Create/parse a mdrpi:RegistrationInfo element.

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

Definition at line 44 of file RegistrationInfo.php.

References $xml, SAML2\Utils\extractLocalizedStrings(), SAML2\XML\mdrpi\Common\NS_MDRPI, and SAML2\Utils\xsDateTimeToTimestamp().

45  {
46  if ($xml === null) {
47  return;
48  }
49 
50  if (!$xml->hasAttribute('registrationAuthority')) {
51  throw new \Exception('Missing required attribute "registrationAuthority" in mdrpi:RegistrationInfo element.');
52  }
53  $this->registrationAuthority = $xml->getAttribute('registrationAuthority');
54 
55  if ($xml->hasAttribute('registrationInstant')) {
56  $this->registrationInstant = Utils::xsDateTimeToTimestamp($xml->getAttribute('registrationInstant'));
57  }
58 
59  $this->RegistrationPolicy = Utils::extractLocalizedStrings($xml, Common::NS_MDRPI, 'RegistrationPolicy');
60  }
static extractLocalizedStrings(\DOMElement $parent, $namespaceURI, $localName)
Extract localized strings from a set of nodes.
Definition: Utils.php:580
$xml
Definition: metadata.php:240
static xsDateTimeToTimestamp($time)
This function converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z to a UNIX timestamp...
Definition: Utils.php:721
+ Here is the call graph for this function:

Member Function Documentation

◆ toXML()

SAML2\XML\mdrpi\RegistrationInfo::toXML ( \DOMElement  $parent)

Convert this element to XML.

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

Definition at line 68 of file RegistrationInfo.php.

References SAML2\Utils\addStrings(), and SAML2\XML\mdrpi\Common\NS_MDRPI.

69  {
70  assert(is_string($this->registrationAuthority));
71  assert(is_int($this->registrationInstant) || is_null($this->registrationInstant));
72  assert(is_array($this->RegistrationPolicy));
73 
74  if (empty($this->registrationAuthority)) {
75  throw new \Exception('Missing required registration authority.');
76  }
77 
78  $doc = $parent->ownerDocument;
79 
80  $e = $doc->createElementNS(Common::NS_MDRPI, 'mdrpi:RegistrationInfo');
81  $parent->appendChild($e);
82 
83  $e->setAttribute('registrationAuthority', $this->registrationAuthority);
84 
85  if ($this->registrationInstant !== null) {
86  $e->setAttribute('registrationInstant', gmdate('Y-m-d\TH:i:s\Z', $this->registrationInstant));
87  }
88 
89  Utils::addStrings($e, Common::NS_MDRPI, 'mdrpi:RegistrationPolicy', true, $this->RegistrationPolicy);
90 
91  return $e;
92  }
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

◆ $registrationAuthority

SAML2\XML\mdrpi\RegistrationInfo::$registrationAuthority

Definition at line 20 of file RegistrationInfo.php.

◆ $registrationInstant

SAML2\XML\mdrpi\RegistrationInfo::$registrationInstant

Definition at line 27 of file RegistrationInfo.php.

◆ $RegistrationPolicy

SAML2\XML\mdrpi\RegistrationInfo::$RegistrationPolicy = array()

Definition at line 36 of file RegistrationInfo.php.


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