Exemplo n.º 1
0
 /**
  * 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') . ':' . 'access':
             $access = new Extension\Access();
             $access->transferFromDOM($child);
             $this->_gphotoAccess = $access;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'location':
             $location = new Extension\Location();
             $location->transferFromDOM($child);
             $this->_gphotoLocation = $location;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'name':
             $name = new Extension\Name();
             $name->transferFromDOM($child);
             $this->_gphotoName = $name;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'numphotos':
             $numPhotos = new Extension\NumPhotos();
             $numPhotos->transferFromDOM($child);
             $this->_gphotoNumPhotos = $numPhotos;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
             $commentCount = new Extension\CommentCount();
             $commentCount->transferFromDOM($child);
             $this->_gphotoCommentCount = $commentCount;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
             $commentingEnabled = new Extension\CommentingEnabled();
             $commentingEnabled->transferFromDOM($child);
             $this->_gphotoCommentingEnabled = $commentingEnabled;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'id':
             $id = new Extension\Id();
             $id->transferFromDOM($child);
             $this->_gphotoId = $id;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'user':
             $user = new Extension\User();
             $user->transferFromDOM($child);
             $this->_gphotoUser = $user;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
             $timestamp = new Extension\Timestamp();
             $timestamp->transferFromDOM($child);
             $this->_gphotoTimestamp = $timestamp;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'nickname':
             $nickname = new Extension\Nickname();
             $nickname->transferFromDOM($child);
             $this->_gphotoNickname = $nickname;
             break;
         case $this->lookupNamespace('georss') . ':' . 'where':
             $geoRssWhere = new \ZendGData\Geo\Extension\GeoRssWhere();
             $geoRssWhere->transferFromDOM($child);
             $this->_geoRssWhere = $geoRssWhere;
             break;
         case $this->lookupNamespace('media') . ':' . 'group':
             $mediaGroup = new \ZendGData\Media\Extension\MediaGroup();
             $mediaGroup->transferFromDOM($child);
             $this->_mediaGroup = $mediaGroup;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * 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->_gphotoTimestamp !== null) {
         $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoUser !== null) {
         $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoNickname !== null) {
         $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoAccess !== null) {
         $element->appendChild($this->_gphotoAccess->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoLocation !== null) {
         $element->appendChild($this->_gphotoLocation->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoName !== null) {
         $element->appendChild($this->_gphotoName->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoNumPhotos !== null) {
         $element->appendChild($this->_gphotoNumPhotos->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoCommentCount !== null) {
         $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoCommentingEnabled !== null) {
         $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoId !== null) {
         $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument));
     }
     if ($this->_mediaGroup !== null) {
         $element->appendChild($this->_mediaGroup->getDOM($element->ownerDocument));
     }
     return $element;
 }
Exemplo n.º 3
0
 /**
  * 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') . ':' . 'albumid':
             $albumId = new Extension\AlbumId();
             $albumId->transferFromDOM($child);
             $this->_gphotoAlbumId = $albumId;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'id':
             $id = new Extension\Id();
             $id->transferFromDOM($child);
             $this->_gphotoId = $id;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'version':
             $version = new Extension\Version();
             $version->transferFromDOM($child);
             $this->_gphotoVersion = $version;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'width':
             $width = new Extension\Width();
             $width->transferFromDOM($child);
             $this->_gphotoWidth = $width;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'height':
             $height = new Extension\Height();
             $height->transferFromDOM($child);
             $this->_gphotoHeight = $height;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'size':
             $size = new Extension\Size();
             $size->transferFromDOM($child);
             $this->_gphotoSize = $size;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'client':
             $client = new Extension\Client();
             $client->transferFromDOM($child);
             $this->_gphotoClient = $client;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'checksum':
             $checksum = new Extension\Checksum();
             $checksum->transferFromDOM($child);
             $this->_gphotoChecksum = $checksum;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
             $timestamp = new Extension\Timestamp();
             $timestamp->transferFromDOM($child);
             $this->_gphotoTimestamp = $timestamp;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
             $commentingEnabled = new Extension\CommentingEnabled();
             $commentingEnabled->transferFromDOM($child);
             $this->_gphotoCommentingEnabled = $commentingEnabled;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
             $commentCount = new Extension\CommentCount();
             $commentCount->transferFromDOM($child);
             $this->_gphotoCommentCount = $commentCount;
             break;
         case $this->lookupNamespace('exif') . ':' . 'tags':
             $exifTags = new \ZendGData\EXIF\Extension\Tags();
             $exifTags->transferFromDOM($child);
             $this->_exifTags = $exifTags;
             break;
         case $this->lookupNamespace('georss') . ':' . 'where':
             $geoRssWhere = new \ZendGData\Geo\Extension\GeoRssWhere();
             $geoRssWhere->transferFromDOM($child);
             $this->_geoRssWhere = $geoRssWhere;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Exemplo n.º 4
0
 /**
  * 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->_gphotoAlbumId !== null) {
         $element->appendChild($this->_gphotoAlbumId->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoId !== null) {
         $element->appendChild($this->_gphotoId->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoVersion !== null) {
         $element->appendChild($this->_gphotoVersion->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoWidth !== null) {
         $element->appendChild($this->_gphotoWidth->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoHeight !== null) {
         $element->appendChild($this->_gphotoHeight->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoSize !== null) {
         $element->appendChild($this->_gphotoSize->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoClient !== null) {
         $element->appendChild($this->_gphotoClient->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoChecksum !== null) {
         $element->appendChild($this->_gphotoChecksum->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoTimestamp !== null) {
         $element->appendChild($this->_gphotoTimestamp->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoCommentingEnabled !== null) {
         $element->appendChild($this->_gphotoCommentingEnabled->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoCommentCount !== null) {
         $element->appendChild($this->_gphotoCommentCount->getDOM($element->ownerDocument));
     }
     if ($this->_exifTags !== null) {
         $element->appendChild($this->_exifTags->getDOM($element->ownerDocument));
     }
     if ($this->_geoRssWhere !== null) {
         $element->appendChild($this->_geoRssWhere->getDOM($element->ownerDocument));
     }
     return $element;
 }
Exemplo n.º 5
0
 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') . ':' . 'version':
             $version = new Extension\Version();
             $version->transferFromDOM($child);
             $this->_gphotoVersion = $version;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'albumid':
             $albumid = new Extension\AlbumId();
             $albumid->transferFromDOM($child);
             $this->_gphotoAlbumId = $albumid;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'width':
             $width = new Extension\Width();
             $width->transferFromDOM($child);
             $this->_gphotoWidth = $width;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'height':
             $height = new Extension\Height();
             $height->transferFromDOM($child);
             $this->_gphotoHeight = $height;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'size':
             $size = new Extension\Size();
             $size->transferFromDOM($child);
             $this->_gphotoSize = $size;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'client':
             $client = new Extension\Client();
             $client->transferFromDOM($child);
             $this->_gphotoClient = $client;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'checksum':
             $checksum = new Extension\Checksum();
             $checksum->transferFromDOM($child);
             $this->_gphotoChecksum = $checksum;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
             $timestamp = new Extension\Timestamp();
             $timestamp->transferFromDOM($child);
             $this->_gphotoTimestamp = $timestamp;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
             $commentingEnabled = new Extension\CommentingEnabled();
             $commentingEnabled->transferFromDOM($child);
             $this->_gphotoCommentingEnabled = $commentingEnabled;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
             $commentCount = new Extension\CommentCount();
             $commentCount->transferFromDOM($child);
             $this->_gphotoCommentCount = $commentCount;
             break;
         case $this->lookupNamespace('media') . ':' . 'group':
             $mediaGroup = new \ZendGData\Media\Extension\MediaGroup();
             $mediaGroup->transferFromDOM($child);
             $this->_mediaGroup = $mediaGroup;
             break;
         case $this->lookupNamespace('atom') . ':' . 'entry':
             $entryClassName = $this->_entryClassName;
             $tmpEntry = new \ZendGData\App\Entry($child);
             $categories = $tmpEntry->getCategory();
             foreach ($categories as $category) {
                 if ($category->scheme == Photos::KIND_PATH && $this->_entryKindClassMapping[$category->term] != "") {
                     $entryClassName = $this->_entryKindClassMapping[$category->term];
                     break;
                 } else {
                     throw new \ZendGData\App\Exception('Entry is missing kind declaration.');
                 }
             }
             $newEntry = new $entryClassName($child);
             $newEntry->setService($this->getService());
             $this->_entry[] = $newEntry;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Exemplo n.º 6
0
 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') . ':' . 'user':
             $user = new Extension\User();
             $user->transferFromDOM($child);
             $this->_gphotoUser = $user;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'nickname':
             $nickname = new Extension\Nickname();
             $nickname->transferFromDOM($child);
             $this->_gphotoNickname = $nickname;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'name':
             $name = new Extension\Name();
             $name->transferFromDOM($child);
             $this->_gphotoName = $name;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'location':
             $location = new Extension\Location();
             $location->transferFromDOM($child);
             $this->_gphotoLocation = $location;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'access':
             $access = new Extension\Access();
             $access->transferFromDOM($child);
             $this->_gphotoAccess = $access;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'timestamp':
             $timestamp = new Extension\Timestamp();
             $timestamp->transferFromDOM($child);
             $this->_gphotoTimestamp = $timestamp;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'numphotos':
             $numphotos = new Extension\NumPhotos();
             $numphotos->transferFromDOM($child);
             $this->_gphotoNumPhotos = $numphotos;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentingEnabled':
             $commentingEnabled = new Extension\CommentingEnabled();
             $commentingEnabled->transferFromDOM($child);
             $this->_gphotoCommentingEnabled = $commentingEnabled;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'commentCount':
             $commentCount = new Extension\CommentCount();
             $commentCount->transferFromDOM($child);
             $this->_gphotoCommentCount = $commentCount;
             break;
         case $this->lookupNamespace('atom') . ':' . 'entry':
             $entryClassName = $this->_entryClassName;
             $tmpEntry = new \ZendGData\App\Entry($child);
             $categories = $tmpEntry->getCategory();
             foreach ($categories as $category) {
                 if ($category->scheme == Photos::KIND_PATH && $this->_entryKindClassMapping[$category->term] != "") {
                     $entryClassName = $this->_entryKindClassMapping[$category->term];
                     break;
                 } else {
                     throw new \ZendGData\App\Exception('Entry is missing kind declaration.');
                 }
             }
             $newEntry = new $entryClassName($child);
             $newEntry->setService($this->getService());
             $this->_entry[] = $newEntry;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }