public function __construct(\DOMElement $xml = null)
{
if ($xml === null) {
return;
}
if (!$xml->hasAttribute('width')) {
throw new \Exception('Missing width of Logo.');
}
if (!$xml->hasAttribute('height')) {
throw new \Exception('Missing height of Logo.');
}
if (!is_string($xml->textContent) || !strlen($xml->textContent)) {
throw new \Exception('Missing url value for Logo.');
}
$this->url = $xml->textContent;
$this->width = (int) $xml->getAttribute('width');
$this->height = (int) $xml->getAttribute('height');
$this->lang = $xml->hasAttribute('xml:lang') ? $xml->getAttribute('xml:lang') : null;
}