|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Extension.php'; 00028 00032 require_once 'Zend/Gdata/Entry.php'; 00033 00037 require_once 'Zend/Gdata/Media/Extension/MediaContent.php'; 00038 00042 require_once 'Zend/Gdata/Media/Extension/MediaCategory.php'; 00043 00047 require_once 'Zend/Gdata/Media/Extension/MediaCopyright.php'; 00048 00052 require_once 'Zend/Gdata/Media/Extension/MediaCredit.php'; 00053 00057 require_once 'Zend/Gdata/Media/Extension/MediaDescription.php'; 00058 00062 require_once 'Zend/Gdata/Media/Extension/MediaHash.php'; 00063 00067 require_once 'Zend/Gdata/Media/Extension/MediaKeywords.php'; 00068 00072 require_once 'Zend/Gdata/Media/Extension/MediaPlayer.php'; 00073 00077 require_once 'Zend/Gdata/Media/Extension/MediaRating.php'; 00078 00082 require_once 'Zend/Gdata/Media/Extension/MediaRestriction.php'; 00083 00087 require_once 'Zend/Gdata/Media/Extension/MediaText.php'; 00088 00092 require_once 'Zend/Gdata/Media/Extension/MediaThumbnail.php'; 00093 00097 require_once 'Zend/Gdata/Media/Extension/MediaTitle.php'; 00098 00099 00112 class Zend_Gdata_Media_Extension_MediaGroup extends Zend_Gdata_Extension 00113 { 00114 00115 protected $_rootElement = 'group'; 00116 protected $_rootNamespace = 'media'; 00117 00121 protected $_content = array(); 00122 00126 protected $_category = array(); 00127 00131 protected $_copyright = null; 00132 00136 protected $_credit = array(); 00137 00141 protected $_description = null; 00142 00146 protected $_hash = array(); 00147 00151 protected $_keywords = null; 00152 00156 protected $_player = array(); 00157 00161 protected $_rating = array(); 00162 00166 protected $_restriction = array(); 00167 00171 protected $_mediaText = array(); 00172 00176 protected $_thumbnail = array(); 00177 00181 protected $_title = null; 00182 00186 public function __construct($element = null) 00187 { 00188 $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 00189 parent::__construct($element); 00190 } 00191 00202 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00203 { 00204 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00205 foreach ($this->_content as $content) { 00206 $element->appendChild($content->getDOM($element->ownerDocument)); 00207 } 00208 foreach ($this->_category as $category) { 00209 $element->appendChild($category->getDOM($element->ownerDocument)); 00210 } 00211 foreach ($this->_credit as $credit) { 00212 $element->appendChild($credit->getDOM($element->ownerDocument)); 00213 } 00214 foreach ($this->_player as $player) { 00215 $element->appendChild($player->getDOM($element->ownerDocument)); 00216 } 00217 foreach ($this->_rating as $rating) { 00218 $element->appendChild($rating->getDOM($element->ownerDocument)); 00219 } 00220 foreach ($this->_restriction as $restriction) { 00221 $element->appendChild($restriction->getDOM($element->ownerDocument)); 00222 } 00223 foreach ($this->_mediaText as $text) { 00224 $element->appendChild($text->getDOM($element->ownerDocument)); 00225 } 00226 foreach ($this->_thumbnail as $thumbnail) { 00227 $element->appendChild($thumbnail->getDOM($element->ownerDocument)); 00228 } 00229 if ($this->_copyright != null) { 00230 $element->appendChild( 00231 $this->_copyright->getDOM($element->ownerDocument)); 00232 } 00233 if ($this->_description != null) { 00234 $element->appendChild( 00235 $this->_description->getDOM($element->ownerDocument)); 00236 } 00237 foreach ($this->_hash as $hash) { 00238 $element->appendChild($hash->getDOM($element->ownerDocument)); 00239 } 00240 if ($this->_keywords != null) { 00241 $element->appendChild( 00242 $this->_keywords->getDOM($element->ownerDocument)); 00243 } 00244 if ($this->_title != null) { 00245 $element->appendChild( 00246 $this->_title->getDOM($element->ownerDocument)); 00247 } 00248 return $element; 00249 } 00250 00257 protected function takeChildFromDOM($child) 00258 { 00259 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00260 switch ($absoluteNodeName) { 00261 case $this->lookupNamespace('media') . ':' . 'content'; 00262 $content = new Zend_Gdata_Media_Extension_MediaContent(); 00263 $content->transferFromDOM($child); 00264 $this->_content[] = $content; 00265 break; 00266 case $this->lookupNamespace('media') . ':' . 'category'; 00267 $category = new Zend_Gdata_Media_Extension_MediaCategory(); 00268 $category->transferFromDOM($child); 00269 $this->_category[] = $category; 00270 break; 00271 case $this->lookupNamespace('media') . ':' . 'copyright'; 00272 $copyright = new Zend_Gdata_Media_Extension_MediaCopyright(); 00273 $copyright->transferFromDOM($child); 00274 $this->_copyright = $copyright; 00275 break; 00276 case $this->lookupNamespace('media') . ':' . 'credit'; 00277 $credit = new Zend_Gdata_Media_Extension_MediaCredit(); 00278 $credit->transferFromDOM($child); 00279 $this->_credit[] = $credit; 00280 break; 00281 case $this->lookupNamespace('media') . ':' . 'description'; 00282 $description = new Zend_Gdata_Media_Extension_MediaDescription(); 00283 $description->transferFromDOM($child); 00284 $this->_description = $description; 00285 break; 00286 case $this->lookupNamespace('media') . ':' . 'hash'; 00287 $hash = new Zend_Gdata_Media_Extension_MediaHash(); 00288 $hash->transferFromDOM($child); 00289 $this->_hash[] = $hash; 00290 break; 00291 case $this->lookupNamespace('media') . ':' . 'keywords'; 00292 $keywords = new Zend_Gdata_Media_Extension_MediaKeywords(); 00293 $keywords->transferFromDOM($child); 00294 $this->_keywords = $keywords; 00295 break; 00296 case $this->lookupNamespace('media') . ':' . 'player'; 00297 $player = new Zend_Gdata_Media_Extension_MediaPlayer(); 00298 $player->transferFromDOM($child); 00299 $this->_player[] = $player; 00300 break; 00301 case $this->lookupNamespace('media') . ':' . 'rating'; 00302 $rating = new Zend_Gdata_Media_Extension_MediaRating(); 00303 $rating->transferFromDOM($child); 00304 $this->_rating[] = $rating; 00305 break; 00306 case $this->lookupNamespace('media') . ':' . 'restriction'; 00307 $restriction = new Zend_Gdata_Media_Extension_MediaRestriction(); 00308 $restriction->transferFromDOM($child); 00309 $this->_restriction[] = $restriction; 00310 break; 00311 case $this->lookupNamespace('media') . ':' . 'text'; 00312 $text = new Zend_Gdata_Media_Extension_MediaText(); 00313 $text->transferFromDOM($child); 00314 $this->_mediaText[] = $text; 00315 break; 00316 case $this->lookupNamespace('media') . ':' . 'thumbnail'; 00317 $thumbnail = new Zend_Gdata_Media_Extension_MediaThumbnail(); 00318 $thumbnail->transferFromDOM($child); 00319 $this->_thumbnail[] = $thumbnail; 00320 break; 00321 case $this->lookupNamespace('media') . ':' . 'title'; 00322 $title = new Zend_Gdata_Media_Extension_MediaTitle(); 00323 $title->transferFromDOM($child); 00324 $this->_title = $title; 00325 break; 00326 default: 00327 parent::takeChildFromDOM($child); 00328 break; 00329 } 00330 } 00331 00335 public function getContent() 00336 { 00337 return $this->_content; 00338 } 00339 00344 public function setContent($value) 00345 { 00346 $this->_content = $value; 00347 return $this; 00348 } 00349 00353 public function getCategory() 00354 { 00355 return $this->_category; 00356 } 00357 00362 public function setCategory($value) 00363 { 00364 $this->_category = $value; 00365 return $this; 00366 } 00367 00371 public function getCopyright() 00372 { 00373 return $this->_copyright; 00374 } 00375 00380 public function setCopyright($value) 00381 { 00382 $this->_copyright = $value; 00383 return $this; 00384 } 00385 00389 public function getCredit() 00390 { 00391 return $this->_credit; 00392 } 00393 00398 public function setCredit($value) 00399 { 00400 $this->_credit = $value; 00401 return $this; 00402 } 00403 00407 public function getTitle() 00408 { 00409 return $this->_title; 00410 } 00411 00416 public function setTitle($value) 00417 { 00418 $this->_title = $value; 00419 return $this; 00420 } 00421 00425 public function getDescription() 00426 { 00427 return $this->_description; 00428 } 00429 00434 public function setDescription($value) 00435 { 00436 $this->_description = $value; 00437 return $this; 00438 } 00439 00443 public function getHash() 00444 { 00445 return $this->_hash; 00446 } 00447 00452 public function setHash($value) 00453 { 00454 $this->_hash = $value; 00455 return $this; 00456 } 00457 00461 public function getKeywords() 00462 { 00463 return $this->_keywords; 00464 } 00465 00470 public function setKeywords($value) 00471 { 00472 $this->_keywords = $value; 00473 return $this; 00474 } 00475 00479 public function getPlayer() 00480 { 00481 return $this->_player; 00482 } 00483 00488 public function setPlayer($value) 00489 { 00490 $this->_player = $value; 00491 return $this; 00492 } 00493 00497 public function getRating() 00498 { 00499 return $this->_rating; 00500 } 00501 00506 public function setRating($value) 00507 { 00508 $this->_rating = $value; 00509 return $this; 00510 } 00511 00515 public function getRestriction() 00516 { 00517 return $this->_restriction; 00518 } 00519 00524 public function setRestriction($value) 00525 { 00526 $this->_restriction = $value; 00527 return $this; 00528 } 00529 00533 public function getThumbnail() 00534 { 00535 return $this->_thumbnail; 00536 } 00537 00542 public function setThumbnail($value) 00543 { 00544 $this->_thumbnail = $value; 00545 return $this; 00546 } 00547 00551 public function getMediaText() 00552 { 00553 return $this->_mediaText; 00554 } 00555 00560 public function setMediaText($value) 00561 { 00562 $this->_mediaText = $value; 00563 return $this; 00564 } 00565 00566 }