SAML2\XML\mdui\Keywords::__construct PHP Метод

__construct() публичный Метод

Initialize a Keywords.
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('xml:lang')) {
            throw new \Exception('Missing lang on Keywords.');
        }
        if (!is_string($xml->textContent) || !strlen($xml->textContent)) {
            throw new \Exception('Missing value for Keywords.');
        }
        $this->Keywords = array();
        foreach (explode(' ', $xml->textContent) as $keyword) {
            $this->Keywords[] = str_replace('+', ' ', $keyword);
        }
        $this->lang = $xml->getAttribute('xml:lang');
    }