ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
RequestedAttribute.php
Go to the documentation of this file.
1 <?php
2 
3 namespace SAML2\XML\md;
4 
6 use SAML2\Utils;
8 
15 {
21  public $isRequired = null;
22 
28  public function __construct(\DOMElement $xml = null)
29  {
30  parent::__construct($xml);
31 
32  if ($xml === null) {
33  return;
34  }
35 
36  $this->isRequired = Utils::parseBoolean($xml, 'isRequired', null);
37  }
38 
45  public function toXML(\DOMElement $parent)
46  {
47  assert(is_bool($this->isRequired) || is_null($this->isRequired));
48 
49  $e = $this->toXMLInternal($parent, Constants::NS_MD, 'md:RequestedAttribute');
50 
51  if ($this->isRequired === true) {
52  $e->setAttribute('isRequired', 'true');
53  } elseif ($this->isRequired === false) {
54  $e->setAttribute('isRequired', 'false');
55  }
56 
57  return $e;
58  }
59 }
toXML(\DOMElement $parent)
Convert this RequestedAttribute to XML.
static parseBoolean(\DOMElement $node, $attributeName, $default=null)
Parse a boolean attribute.
Definition: Utils.php:276
const NS_MD
The namespace for the SAML 2 metadata.
Definition: Constants.php:230
__construct(\DOMElement $xml=null)
Initialize an RequestedAttribute.
toXMLInternal(\DOMElement $parent, $namespace, $name)
Internal implementation of toXML.
Definition: Attribute.php:84