|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Entry.php'; 00028 00032 require_once 'Zend/Gdata/Gapps.php'; 00033 00037 require_once 'Zend/Gdata/Photos/Extension/Nickname.php'; 00038 00042 require_once 'Zend/Gdata/Photos/Extension/Thumbnail.php'; 00043 00047 require_once 'Zend/Gdata/Photos/Extension/QuotaCurrent.php'; 00048 00052 require_once 'Zend/Gdata/Photos/Extension/QuotaLimit.php'; 00053 00057 require_once 'Zend/Gdata/Photos/Extension/MaxPhotosPerAlbum.php'; 00058 00062 require_once 'Zend/Gdata/Photos/Extension/User.php'; 00063 00067 require_once 'Zend/Gdata/App/Extension/Category.php'; 00068 00084 class Zend_Gdata_Photos_UserEntry extends Zend_Gdata_Entry 00085 { 00086 00087 protected $_entryClassName = 'Zend_Gdata_Photos_UserEntry'; 00088 00094 protected $_gphotoNickname = null; 00095 00101 protected $_gphotoUser = null; 00102 00108 protected $_gphotoThumbnail = null; 00109 00115 protected $_gphotoQuotaLimit = null; 00116 00122 protected $_gphotoQuotaCurrent = null; 00123 00129 protected $_gphotoMaxPhotosPerAlbum = null; 00130 00137 public function __construct($element = null) 00138 { 00139 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); 00140 parent::__construct($element); 00141 00142 $category = new Zend_Gdata_App_Extension_Category( 00143 'http://schemas.google.com/photos/2007#user', 00144 'http://schemas.google.com/g/2005#kind'); 00145 $this->setCategory(array($category)); 00146 } 00147 00157 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00158 { 00159 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00160 if ($this->_gphotoNickname !== null) { 00161 $element->appendChild($this->_gphotoNickname->getDOM($element->ownerDocument)); 00162 } 00163 if ($this->_gphotoThumbnail !== null) { 00164 $element->appendChild($this->_gphotoThumbnail->getDOM($element->ownerDocument)); 00165 } 00166 if ($this->_gphotoUser !== null) { 00167 $element->appendChild($this->_gphotoUser->getDOM($element->ownerDocument)); 00168 } 00169 if ($this->_gphotoQuotaCurrent !== null) { 00170 $element->appendChild($this->_gphotoQuotaCurrent->getDOM($element->ownerDocument)); 00171 } 00172 if ($this->_gphotoQuotaLimit !== null) { 00173 $element->appendChild($this->_gphotoQuotaLimit->getDOM($element->ownerDocument)); 00174 } 00175 if ($this->_gphotoMaxPhotosPerAlbum !== null) { 00176 $element->appendChild($this->_gphotoMaxPhotosPerAlbum->getDOM($element->ownerDocument)); 00177 } 00178 return $element; 00179 } 00180 00187 protected function takeChildFromDOM($child) 00188 { 00189 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00190 00191 switch ($absoluteNodeName) { 00192 case $this->lookupNamespace('gphoto') . ':' . 'nickname'; 00193 $nickname = new Zend_Gdata_Photos_Extension_Nickname(); 00194 $nickname->transferFromDOM($child); 00195 $this->_gphotoNickname = $nickname; 00196 break; 00197 case $this->lookupNamespace('gphoto') . ':' . 'thumbnail'; 00198 $thumbnail = new Zend_Gdata_Photos_Extension_Thumbnail(); 00199 $thumbnail->transferFromDOM($child); 00200 $this->_gphotoThumbnail = $thumbnail; 00201 break; 00202 case $this->lookupNamespace('gphoto') . ':' . 'user'; 00203 $user = new Zend_Gdata_Photos_Extension_User(); 00204 $user->transferFromDOM($child); 00205 $this->_gphotoUser = $user; 00206 break; 00207 case $this->lookupNamespace('gphoto') . ':' . 'quotacurrent'; 00208 $quotaCurrent = new Zend_Gdata_Photos_Extension_QuotaCurrent(); 00209 $quotaCurrent->transferFromDOM($child); 00210 $this->_gphotoQuotaCurrent = $quotaCurrent; 00211 break; 00212 case $this->lookupNamespace('gphoto') . ':' . 'quotalimit'; 00213 $quotaLimit = new Zend_Gdata_Photos_Extension_QuotaLimit(); 00214 $quotaLimit->transferFromDOM($child); 00215 $this->_gphotoQuotaLimit = $quotaLimit; 00216 break; 00217 case $this->lookupNamespace('gphoto') . ':' . 'maxPhotosPerAlbum'; 00218 $maxPhotosPerAlbum = new Zend_Gdata_Photos_Extension_MaxPhotosPerAlbum(); 00219 $maxPhotosPerAlbum->transferFromDOM($child); 00220 $this->_gphotoMaxPhotosPerAlbum = $maxPhotosPerAlbum; 00221 break; 00222 default: 00223 parent::takeChildFromDOM($child); 00224 break; 00225 } 00226 } 00227 00234 public function getGphotoNickname() 00235 { 00236 return $this->_gphotoNickname; 00237 } 00238 00245 public function setGphotoNickname($value) 00246 { 00247 $this->_gphotoNickname = $value; 00248 return $this; 00249 } 00250 00257 public function getGphotoThumbnail() 00258 { 00259 return $this->_gphotoThumbnail; 00260 } 00261 00268 public function setGphotoThumbnail($value) 00269 { 00270 $this->_gphotoThumbnail = $value; 00271 return $this; 00272 } 00273 00280 public function getGphotoQuotaCurrent() 00281 { 00282 return $this->_gphotoQuotaCurrent; 00283 } 00284 00291 public function setGphotoQuotaCurrent($value) 00292 { 00293 $this->_gphotoQuotaCurrent = $value; 00294 return $this; 00295 } 00296 00303 public function getGphotoQuotaLimit() 00304 { 00305 return $this->_gphotoQuotaLimit; 00306 } 00307 00314 public function setGphotoQuotaLimit($value) 00315 { 00316 $this->_gphotoQuotaLimit = $value; 00317 return $this; 00318 } 00319 00326 public function getGphotoMaxPhotosPerAlbum() 00327 { 00328 return $this->_gphotoMaxPhotosPerAlbum; 00329 } 00330 00337 public function setGphotoMaxPhotosPerAlbum($value) 00338 { 00339 $this->_gphotoMaxPhotosPerAlbum = $value; 00340 return $this; 00341 } 00342 00349 public function getGphotoUser() 00350 { 00351 return $this->_gphotoUser; 00352 } 00353 00360 public function setGphotoUser($value) 00361 { 00362 $this->_gphotoUser = $value; 00363 return $this; 00364 } 00365 00366 }