SAML2\XML\md\ContactPerson::__construct PHP Method

__construct() public method

Initialize a ContactPerson element.
public __construct ( DOMElement $xml = null )
$xml DOMElement The XML element we should load.
    public function __construct(\DOMElement $xml = null)
    {
        if ($xml === null) {
            return;
        }
        if (!$xml->hasAttribute('contactType')) {
            throw new \Exception('Missing contactType on ContactPerson.');
        }
        $this->contactType = $xml->getAttribute('contactType');
        $this->Extensions = Extensions::getList($xml);
        $this->Company = self::getStringElement($xml, 'Company');
        $this->GivenName = self::getStringElement($xml, 'GivenName');
        $this->SurName = self::getStringElement($xml, 'SurName');
        $this->EmailAddress = self::getStringElements($xml, 'EmailAddress');
        $this->TelephoneNumber = self::getStringElements($xml, 'TelephoneNumber');
        foreach ($xml->attributes as $attr) {
            if ($attr->nodeName == "contactType") {
                continue;
            }
            $this->ContactPersonAttributes[$attr->nodeName] = $attr->nodeValue;
        }
    }