diff -r 000000000000 -r 4eba9c11703f web/Zend/Gdata/YouTube/Extension/MediaGroup.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Gdata/YouTube/Extension/MediaGroup.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,336 @@ +registerAllNamespaces(Zend_Gdata_YouTube::$namespaces); + parent::__construct($element); + } + + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_duration !== null) { + $element->appendChild( + $this->_duration->getDOM($element->ownerDocument)); + } + if ($this->_private !== null) { + $element->appendChild( + $this->_private->getDOM($element->ownerDocument)); + } + if ($this->_videoid != null) { + $element->appendChild( + $this->_videoid->getDOM($element->ownerDocument)); + } + if ($this->_uploaded != null) { + $element->appendChild( + $this->_uploaded->getDOM($element->ownerDocument)); + } + if ($this->_mediacredit != null) { + $element->appendChild( + $this->_mediacredit->getDOM($element->ownerDocument)); + } + if ($this->_mediarating != null) { + $element->appendChild( + $this->_mediarating->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them in the $_entry array 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('media') . ':' . 'content': + $content = new Zend_Gdata_YouTube_Extension_MediaContent(); + $content->transferFromDOM($child); + $this->_content[] = $content; + break; + case $this->lookupNamespace('media') . ':' . 'rating': + $mediarating = new Zend_Gdata_YouTube_Extension_MediaRating(); + $mediarating->transferFromDOM($child); + $this->_mediarating = $mediarating; + break; + case $this->lookupNamespace('media') . ':' . 'credit': + $mediacredit = new Zend_Gdata_YouTube_Extension_MediaCredit(); + $mediacredit->transferFromDOM($child); + $this->_mediacredit = $mediacredit; + break; + case $this->lookupNamespace('yt') . ':' . 'duration': + $duration = new Zend_Gdata_YouTube_Extension_Duration(); + $duration->transferFromDOM($child); + $this->_duration = $duration; + break; + case $this->lookupNamespace('yt') . ':' . 'private': + $private = new Zend_Gdata_YouTube_Extension_Private(); + $private->transferFromDOM($child); + $this->_private = $private; + break; + case $this->lookupNamespace('yt') . ':' . 'videoid': + $videoid = new Zend_Gdata_YouTube_Extension_VideoId(); + $videoid ->transferFromDOM($child); + $this->_videoid = $videoid; + break; + case $this->lookupNamespace('yt') . ':' . 'uploaded': + $uploaded = new Zend_Gdata_YouTube_Extension_Uploaded(); + $uploaded ->transferFromDOM($child); + $this->_uploaded = $uploaded; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Returns the duration value of this element + * + * @return Zend_Gdata_YouTube_Extension_Duration + */ + public function getDuration() + { + return $this->_duration; + } + + /** + * Sets the duration value of this element + * + * @param Zend_Gdata_YouTube_Extension_Duration $value The duration value + * @return Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent + * interface + */ + public function setDuration($value) + { + $this->_duration = $value; + return $this; + } + + /** + * Returns the videoid value of this element + * + * @return Zend_Gdata_YouTube_Extension_VideoId + */ + public function getVideoId() + { + return $this->_videoid; + } + + /** + * Sets the videoid value of this element + * + * @param Zend_Gdata_YouTube_Extension_VideoId $value The video id value + * @return Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent + * interface + */ + public function setVideoId($value) + { + $this->_videoid = $value; + return $this; + } + + /** + * Returns the yt:uploaded element + * + * @return Zend_Gdata_YouTube_Extension_Uploaded + */ + public function getUploaded() + { + return $this->_uploaded; + } + + /** + * Sets the yt:uploaded element + * + * @param Zend_Gdata_YouTube_Extension_Uploaded $value The uploaded value + * @return Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent + * interface + */ + public function setUploaded($value) + { + $this->_uploaded = $value; + return $this; + } + + /** + * Returns the private value of this element + * + * @return Zend_Gdata_YouTube_Extension_Private + */ + public function getPrivate() + { + return $this->_private; + } + + /** + * Sets the private value of this element + * + * @param Zend_Gdata_YouTube_Extension_Private $value The private value + * @return Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent + * interface + */ + public function setPrivate($value) + { + $this->_private = $value; + return $this; + } + + /** + * Returns the rating value of this element + * + * @return Zend_Gdata_YouTube_Extension_MediaRating + */ + public function getMediaRating() + { + return $this->_mediarating; + } + + /** + * Sets the media:rating value of this element + * + * @param Zend_Gdata_YouTube_Extension_MediaRating $value The rating element + * @return Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent + * interface + */ + public function setMediaRating($value) + { + $this->_mediarating = $value; + return $this; + } + + /** + * Returns the media:credit value of this element + * + * @return Zend_Gdata_YouTube_Extension_MediaCredit + */ + public function getMediaCredit() + { + return $this->_mediacredit; + } + + /** + * Sets the media:credit value of this element + * + * @param Zend_Gdata_YouTube_Extension_MediaCredit $value The credit element + * @return Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent + * interface + */ + public function setMediaCredit($value) + { + $this->_mediacredit = $value; + return $this; + } +}