ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Response.php
Go to the documentation of this file.
1 <?php
2 
3 namespace SAML2;
4 
10 class Response extends StatusResponse
11 {
15  private $assertions;
16 
22  public function __construct(\DOMElement $xml = null)
23  {
24  parent::__construct('Response', $xml);
25 
26  $this->assertions = array();
27 
28  if ($xml === null) {
29  return;
30  }
31 
32  for ($node = $xml->firstChild; $node !== null; $node = $node->nextSibling) {
33  if ($node->namespaceURI !== Constants::NS_SAML) {
34  continue;
35  }
36 
37  if ($node->localName === 'Assertion') {
38  $this->assertions[] = new Assertion($node);
39  } elseif ($node->localName === 'EncryptedAssertion') {
40  $this->assertions[] = new EncryptedAssertion($node);
41  }
42  }
43  }
44 
50  public function getAssertions()
51  {
52  return $this->assertions;
53  }
54 
60  public function setAssertions(array $assertions)
61  {
62  $this->assertions = $assertions;
63  }
64 
70  public function toUnsignedXML()
71  {
72  $root = parent::toUnsignedXML();
73 
75  foreach ($this->assertions as $assertion) {
76  $assertion->toXML($root);
77  }
78 
79  return $root;
80  }
81 }
getAssertions()
Retrieve the assertions in this response.
Definition: Response.php:50
setAssertions(array $assertions)
Set the assertions that should be included in this response.
Definition: Response.php:60
__construct(\DOMElement $xml=null)
Constructor for SAML 2 response messages.
Definition: Response.php:22
$root
Definition: sabredav.php:45
$assertions
The assertions in this response.
Definition: Response.php:15