/** * 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->_gphotoId !== null) { $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument)); } if ($this->_gphotoPhotoId !== null) { $element->appendChild($this->_gphotoPhotoId->getDOM($element->ownerDocument)); } return $element; }
/** * Creates individual Entry objects of the appropriate type and * stores them as members of this entry based upon DOM data. * * @param DOMNode $child The DOMNode to process */ protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { case $this->lookupNamespace('gphoto') . ':' . 'id'; $id = new Extension\Id(); $id->transferFromDOM($child); $this->_gphotoId = $id; break; case $this->lookupNamespace('gphoto') . ':' . 'photoid'; $photoid = new Extension\PhotoId(); $photoid->transferFromDOM($child); $this->_gphotoPhotoId = $photoid; break; default: parent::takeChildFromDOM($child); break; } }