Definition at line 11 of file Logo.php.
◆ __construct()
SAML2\XML\mdui\Logo::__construct |
( |
\DOMElement |
$xml = null | ) |
|
Initialize a Logo.
- Parameters
-
\DOMElement | null | $xml | The XML element we should load. |
- Exceptions
-
Definition at line 47 of file Logo.php.
References $xml.
53 if (!
$xml->hasAttribute(
'width')) {
54 throw new \Exception(
'Missing width of Logo.');
56 if (!
$xml->hasAttribute(
'height')) {
57 throw new \Exception(
'Missing height of Logo.');
59 if (!is_string(
$xml->textContent) || !strlen(
$xml->textContent)) {
60 throw new \Exception(
'Missing url value for Logo.');
62 $this->url =
$xml->textContent;
63 $this->width = (int)
$xml->getAttribute(
'width');
64 $this->height = (int)
$xml->getAttribute(
'height');
65 $this->lang =
$xml->hasAttribute(
'xml:lang') ?
$xml->getAttribute(
'xml:lang') : null;
◆ toXML()
SAML2\XML\mdui\Logo::toXML |
( |
\DOMElement |
$parent | ) |
|
Convert this Logo to XML.
- Parameters
-
\DOMElement | $parent | The element we should append this Logo to. |
- Returns
Definition at line 74 of file Logo.php.
References SAML2\XML\mdui\Common\NS.
76 assert(is_int($this->width));
77 assert(is_int($this->height));
78 assert(is_string($this->url));
80 $doc = $parent->ownerDocument;
82 $e = $doc->createElementNS(
Common::NS,
'mdui:Logo');
83 $e->appendChild($doc->createTextNode($this->url));
84 $e->setAttribute(
'width', (
int) $this->width);
85 $e->setAttribute(
'height', (
int) $this->height);
86 if (isset($this->lang)) {
87 $e->setAttribute(
'xml:lang', $this->lang);
89 $parent->appendChild($e);
◆ $height
SAML2\XML\mdui\Logo::$height |
◆ $lang
SAML2\XML\mdui\Logo::$lang |
◆ $url
SAML2\XML\mdui\Logo::$url |
◆ $width
SAML2\XML\mdui\Logo::$width |
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/saml2/src/SAML2/XML/mdui/Logo.php