AuthzService[] = new SAML2_XML_md_EndpointType($ep); } if (empty($this->AuthzService)) { throw new Exception('Must have at least one AuthzService in PDPDescriptor.'); } foreach (SAML2_Utils::xpQuery($xml, './saml_metadata:AssertionIDRequestService') as $ep) { $this->AssertionIDRequestService[] = new SAML2_XML_md_EndpointType($ep); } $this->NameIDFormat = SAML2_Utils::extractStrings($xml, SAML2_Const::NS_MD, 'NameIDFormat'); } /** * Add this PDPDescriptor to an EntityDescriptor. * * @param DOMElement $parent The EntityDescriptor we should append this IDPSSODescriptor to. */ public function toXML(DOMElement $parent) { assert('is_array($this->AuthzService)'); assert('!empty($this->AuthzService)'); assert('is_array($this->AssertionIDRequestService)'); assert('is_array($this->NameIDFormat)'); $e = parent::toXML($parent); foreach ($this->AuthzService as $ep) { $ep->toXML($e, 'md:AuthzService'); } foreach ($this->AssertionIDRequestService as $ep) { $ep->toXML($e, 'md:AssertionIDRequestService'); } SAML2_Utils::addStrings($e, SAML2_Const::NS_MD, 'md:NameIDFormat', FALSE, $this->NameIDFormat); return $e; } }