|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Media/Extension/MediaGroup.php'; 00028 00032 require_once 'Zend/Gdata/YouTube/Extension/MediaContent.php'; 00033 00037 require_once 'Zend/Gdata/YouTube/Extension/Duration.php'; 00038 00042 require_once 'Zend/Gdata/YouTube/Extension/MediaRating.php'; 00043 00047 require_once 'Zend/Gdata/YouTube/Extension/MediaCredit.php'; 00048 00052 require_once 'Zend/Gdata/YouTube/Extension/Private.php'; 00053 00057 require_once 'Zend/Gdata/YouTube/Extension/VideoId.php'; 00058 00062 require_once 'Zend/Gdata/YouTube/Extension/Uploaded.php'; 00063 00076 class Zend_Gdata_YouTube_Extension_MediaGroup extends Zend_Gdata_Media_Extension_MediaGroup 00077 { 00078 00079 protected $_rootElement = 'group'; 00080 protected $_rootNamespace = 'media'; 00081 00085 protected $_duration = null; 00086 00090 protected $_private = null; 00091 00095 protected $_videoid = null; 00096 00100 protected $_mediarating = null; 00101 00105 protected $_mediacredit = null; 00106 00110 protected $_uploaded = null; 00111 00112 public function __construct($element = null) 00113 { 00114 $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces); 00115 parent::__construct($element); 00116 } 00117 00118 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00119 { 00120 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00121 if ($this->_duration !== null) { 00122 $element->appendChild( 00123 $this->_duration->getDOM($element->ownerDocument)); 00124 } 00125 if ($this->_private !== null) { 00126 $element->appendChild( 00127 $this->_private->getDOM($element->ownerDocument)); 00128 } 00129 if ($this->_videoid != null) { 00130 $element->appendChild( 00131 $this->_videoid->getDOM($element->ownerDocument)); 00132 } 00133 if ($this->_uploaded != null) { 00134 $element->appendChild( 00135 $this->_uploaded->getDOM($element->ownerDocument)); 00136 } 00137 if ($this->_mediacredit != null) { 00138 $element->appendChild( 00139 $this->_mediacredit->getDOM($element->ownerDocument)); 00140 } 00141 if ($this->_mediarating != null) { 00142 $element->appendChild( 00143 $this->_mediarating->getDOM($element->ownerDocument)); 00144 } 00145 return $element; 00146 } 00147 00154 protected function takeChildFromDOM($child) 00155 { 00156 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00157 switch ($absoluteNodeName) { 00158 case $this->lookupNamespace('media') . ':' . 'content': 00159 $content = new Zend_Gdata_YouTube_Extension_MediaContent(); 00160 $content->transferFromDOM($child); 00161 $this->_content[] = $content; 00162 break; 00163 case $this->lookupNamespace('media') . ':' . 'rating': 00164 $mediarating = new Zend_Gdata_YouTube_Extension_MediaRating(); 00165 $mediarating->transferFromDOM($child); 00166 $this->_mediarating = $mediarating; 00167 break; 00168 case $this->lookupNamespace('media') . ':' . 'credit': 00169 $mediacredit = new Zend_Gdata_YouTube_Extension_MediaCredit(); 00170 $mediacredit->transferFromDOM($child); 00171 $this->_mediacredit = $mediacredit; 00172 break; 00173 case $this->lookupNamespace('yt') . ':' . 'duration': 00174 $duration = new Zend_Gdata_YouTube_Extension_Duration(); 00175 $duration->transferFromDOM($child); 00176 $this->_duration = $duration; 00177 break; 00178 case $this->lookupNamespace('yt') . ':' . 'private': 00179 $private = new Zend_Gdata_YouTube_Extension_Private(); 00180 $private->transferFromDOM($child); 00181 $this->_private = $private; 00182 break; 00183 case $this->lookupNamespace('yt') . ':' . 'videoid': 00184 $videoid = new Zend_Gdata_YouTube_Extension_VideoId(); 00185 $videoid ->transferFromDOM($child); 00186 $this->_videoid = $videoid; 00187 break; 00188 case $this->lookupNamespace('yt') . ':' . 'uploaded': 00189 $uploaded = new Zend_Gdata_YouTube_Extension_Uploaded(); 00190 $uploaded ->transferFromDOM($child); 00191 $this->_uploaded = $uploaded; 00192 break; 00193 default: 00194 parent::takeChildFromDOM($child); 00195 break; 00196 } 00197 } 00198 00204 public function getDuration() 00205 { 00206 return $this->_duration; 00207 } 00208 00216 public function setDuration($value) 00217 { 00218 $this->_duration = $value; 00219 return $this; 00220 } 00221 00227 public function getVideoId() 00228 { 00229 return $this->_videoid; 00230 } 00231 00239 public function setVideoId($value) 00240 { 00241 $this->_videoid = $value; 00242 return $this; 00243 } 00244 00250 public function getUploaded() 00251 { 00252 return $this->_uploaded; 00253 } 00254 00262 public function setUploaded($value) 00263 { 00264 $this->_uploaded = $value; 00265 return $this; 00266 } 00267 00273 public function getPrivate() 00274 { 00275 return $this->_private; 00276 } 00277 00285 public function setPrivate($value) 00286 { 00287 $this->_private = $value; 00288 return $this; 00289 } 00290 00296 public function getMediaRating() 00297 { 00298 return $this->_mediarating; 00299 } 00300 00308 public function setMediaRating($value) 00309 { 00310 $this->_mediarating = $value; 00311 return $this; 00312 } 00313 00319 public function getMediaCredit() 00320 { 00321 return $this->_mediacredit; 00322 } 00323 00331 public function setMediaCredit($value) 00332 { 00333 $this->_mediacredit = $value; 00334 return $this; 00335 } 00336 }