57 if (!
$xml->hasAttribute(
'publisher')) {
58 throw new \Exception(
'Missing required attribute "publisher" in mdrpi:PublicationInfo element.');
60 $this->publisher =
$xml->getAttribute(
'publisher');
62 if (
$xml->hasAttribute(
'creationInstant')) {
66 if (
$xml->hasAttribute(
'publicationId')) {
67 $this->publicationId =
$xml->getAttribute(
'publicationId');
81 assert(is_string($this->publisher));
82 assert(is_int($this->creationInstant) || is_null($this->creationInstant));
83 assert(is_string($this->publicationId) || is_null($this->publicationId));
84 assert(is_array($this->UsagePolicy));
86 $doc = $parent->ownerDocument;
89 $parent->appendChild($e);
91 $e->setAttribute(
'publisher', $this->publisher);
93 if ($this->creationInstant !== null) {
94 $e->setAttribute(
'creationInstant', gmdate(
'Y-m-d\TH:i:s\Z', $this->creationInstant));
97 if ($this->publicationId !== null) {
98 $e->setAttribute(
'publicationId', $this->publicationId);
static extractLocalizedStrings(\DOMElement $parent, $namespaceURI, $localName)
Extract localized strings from a set of nodes.
static addStrings(\DOMElement $parent, $namespace, $name, $localized, array $values)
Append string elements.
toXML(\DOMElement $parent)
Convert this element to XML.
__construct(\DOMElement $xml=null)
Create/parse a mdrpi:PublicationInfo element.
Create styles array
The data for the language used.
static xsDateTimeToTimestamp($time)
This function converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z to a UNIX timestamp...