48 if (!
$xml->hasAttribute(
'Method')) {
49 throw new \Exception(
'SubjectConfirmation element without Method attribute.');
54 if (count($nid) > 1) {
55 throw new \Exception(
'More than one NameID in a SubjectConfirmation element.');
56 } elseif (!empty($nid)) {
61 if (count($scd) > 1) {
62 throw new \Exception(
'More than one SubjectConfirmationData child in a SubjectConfirmation element.');
63 } elseif (!empty($scd)) {
76 assert(is_string($this->
Method));
80 $e = $parent->ownerDocument->createElementNS(
Constants::NS_SAML,
'saml:SubjectConfirmation');
81 $parent->appendChild($e);
83 $e->setAttribute(
'Method', $this->
Method);
85 if (isset($this->NameID)) {
86 $this->NameID->toXML($e);
88 if (isset($this->SubjectConfirmationData)) {
89 $this->SubjectConfirmationData->toXML($e);
$sc SubjectConfirmationData
__construct(\DOMElement $xml=null)
Initialize (and parse? a SubjectConfirmation element.
static xpQuery(\DOMNode $node, $query)
Do an XPath query on an XML node.
toXML(\DOMElement $parent)
Convert this element to XML.
const NS_SAML
The namespace for the SAML 2 assertions.