Ejemplo n.º 1
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gphoto') . ':' . 'user':
             $user = new Zend_Gdata_Photos_Extension_User();
             $user->transferFromDOM($child);
             $this->_gphotoUser = $user;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'nickname':
             $nickname = new Zend_Gdata_Photos_Extension_Nickname();
             $nickname->transferFromDOM($child);
             $this->_gphotoNickname = $nickname;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'thumbnail':
             $thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail();
             $thumbnail->transferFromDOM($child);
             $this->_gphotoThumbnail = $thumbnail;
             break;
         case $this->lookupNamespace('atom') . ':' . 'entry':
             $entryClassName = $this->_entryClassName;
             $tmpEntry = new Zend_Gdata_App_Entry($child);
             $categories = $tmpEntry->getCategory();
             foreach ($categories as $category) {
                 if ($category->scheme == Zend_Gdata_Photos::KIND_PATH && $this->_entryKindClassMapping[$category->term] != "") {
                     $entryClassName = $this->_entryKindClassMapping[$category->term];
                     break;
                 } else {
                     require_once 'Zend/Gdata/App/Exception.php';
                     throw new Zend_Gdata_App_Exception('Entry is missing kind declaration.');
                 }
             }
             $newEntry = new $entryClassName($child);
             $newEntry->setHttpClient($this->getHttpClient());
             $this->_entry[] = $newEntry;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Ejemplo n.º 2
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gphoto') . ':' . 'nickname':
             $nickname = new Zend_Gdata_Photos_Extension_Nickname();
             $nickname->transferFromDOM($child);
             $this->_gphotoNickname = $nickname;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'thumbnail':
             $thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail();
             $thumbnail->transferFromDOM($child);
             $this->_gphotoThumbnail = $thumbnail;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'user':
             $user = new Zend_Gdata_Photos_Extension_User();
             $user->transferFromDOM($child);
             $this->_gphotoUser = $user;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'quotacurrent':
             $quotaCurrent = new Zend_Gdata_Photos_Extension_QuotaCurrent();
             $quotaCurrent->transferFromDOM($child);
             $this->_gphotoQuotaCurrent = $quotaCurrent;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'quotalimit':
             $quotaLimit = new Zend_Gdata_Photos_Extension_QuotaLimit();
             $quotaLimit->transferFromDOM($child);
             $this->_gphotoQuotaLimit = $quotaLimit;
             break;
         case $this->lookupNamespace('gphoto') . ':' . 'maxPhotosPerAlbum':
             $maxPhotosPerAlbum = new Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum();
             $maxPhotosPerAlbum->transferFromDOM($child);
             $this->_gphotoMaxPhotosPerAlbum = $maxPhotosPerAlbum;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Ejemplo n.º 3
0
 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     if ($this->_gphotoUser != null) {
         $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoNickname != null) {
         $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument));
     }
     if ($this->_gphotoThumbnail != null) {
         $element->appendChild($this->_gphotoThumbnail->getDOM($element->ownerDocument));
     }
     return $element;
 }