public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) { $element = parent::getDOM($doc, $majorVersion, $minorVersion); foreach ($this->_author as $author) { $element->appendChild($author->getDOM($element->ownerDocument)); } foreach ($this->_category as $category) { $element->appendChild($category->getDOM($element->ownerDocument)); } foreach ($this->_contributor as $contributor) { $element->appendChild($contributor->getDOM($element->ownerDocument)); } if ($this->_id != null) { $element->appendChild($this->_id->getDOM($element->ownerDocument)); } foreach ($this->_link as $link) { $element->appendChild($link->getDOM($element->ownerDocument)); } if ($this->_rights != null) { $element->appendChild($this->_rights->getDOM($element->ownerDocument)); } if ($this->_title != null) { $element->appendChild($this->_title->getDOM($element->ownerDocument)); } if ($this->_updated != null) { $element->appendChild($this->_updated->getDOM($element->ownerDocument)); } return $element; }
/** * Retrieves a DOMElement which corresponds to this element and all * child properties. This is used to build an entry back into a DOM * and eventually XML text for application storage/persistence. * * @param DOMDocument $doc The DOMDocument used to construct DOMElements * @return DOMElement The DOMElement representing this element and all * child properties. */ public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) { $element = parent::getDOM($doc, $majorVersion, $minorVersion); if ($this->_errorCode !== null) { $element->setAttribute('errorCode', $this->_errorCode); } if ($this->_reason !== null) { $element->setAttribute('reason', $this->_reason); } if ($this->_invalidInput !== null) { $element->setAttribute('invalidInput', $this->_invalidInput); } return $element; }