function getXml(\DOMNode $parent, SerializationContext $context) { $result = parent::getXml($parent, $context); if ($this->getNotOnOrAfter()) { $result->setAttribute('NotOnOrAfter', Helper::time2string($this->getNotOnOrAfter())); } if ($this->getReason()) { $result->setAttribute('Reason', $this->getReason()); } if ($this->getNameID()) { $result->appendChild($this->getNameID()->getXml($parent, $context)); } if ($this->getSessionIndex()) { $sessionIndex = $context->getDocument()->createElementNS(Protocol::SAML2, 'samlp:SessionIndex', $this->getSessionIndex()); $result->appendChild($sessionIndex); } return $result; }
/** * @param \DOMNode $parent * @param \AerialShip\LightSaml\Meta\SerializationContext $context * @return \DOMElement */ function getXml(\DOMNode $parent, SerializationContext $context) { $result = parent::getXml($parent, $context); $result->setAttribute('AssertionConsumerServiceURL', $this->getAssertionConsumerServiceURL()); $result->setAttribute('ProtocolBinding', $this->getProtocolBinding()); $nameIDPolicyNode = $context->getDocument()->createElementNS(Protocol::SAML2, 'samlp:NameIDPolicy'); $result->appendChild($nameIDPolicyNode); $nameIDPolicyNode->setAttribute('Format', $this->getNameIdPolicyFormat()); $nameIDPolicyNode->setAttribute('AllowCreate', $this->getNameIdPolicyAllowCreate() ? 'true' : 'false'); return $result; }