ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DigestMethod.php
Go to the documentation of this file.
1<?php
2
3namespace SAML2\XML\alg;
4
13{
19 public $Algorithm;
20
21
29 public function __construct(\DOMElement $xml = null)
30 {
31 if ($xml === null) {
32 return;
33 }
34
35 if (!$xml->hasAttribute('Algorithm')) {
36 throw new \Exception('Missing required attribute "Algorithm" in alg:DigestMethod element.');
37 }
38 $this->Algorithm = $xml->getAttribute('Algorithm');
39 }
40
41
48 public function toXML(\DOMElement $parent)
49 {
50 assert(is_string($this->Algorithm));
51
52 $doc = $parent->ownerDocument;
53 $e = $doc->createElementNS(Common::NS, 'alg:DigestMethod');
54 $parent->appendChild($e);
55 $e->setAttribute('Algorithm', $this->Algorithm);
56
57 return $e;
58 }
59}
An exception for terminatinating execution or to throw for unit testing.
__construct(\DOMElement $xml=null)
Create/parse an alg:DigestMethod element.
toXML(\DOMElement $parent)
Convert this element to XML.
$xml
Definition: metadata.php:240