Example #1
0
 /**
  * Retrieves a DOMElement which corresponds to this element and all
  * child properties.  This is used to build an entry back into a DOM
  * and eventually XML text for sending to the server upon updates, or
  * for application storage/persistence.
  *
  * @param DOMDocument $doc The DOMDocument used to construct DOMElements
  * @return DOMElement The DOMElement representing this element and all
  * child properties.
  */
 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     foreach ($this->_content as $content) {
         $element->appendChild($content->getDOM($element->ownerDocument));
     }
     foreach ($this->_category as $category) {
         $element->appendChild($category->getDOM($element->ownerDocument));
     }
     foreach ($this->_credit as $credit) {
         $element->appendChild($credit->getDOM($element->ownerDocument));
     }
     foreach ($this->_player as $player) {
         $element->appendChild($player->getDOM($element->ownerDocument));
     }
     foreach ($this->_rating as $rating) {
         $element->appendChild($rating->getDOM($element->ownerDocument));
     }
     foreach ($this->_restriction as $restriction) {
         $element->appendChild($restriction->getDOM($element->ownerDocument));
     }
     foreach ($this->_mediaText as $text) {
         $element->appendChild($text->getDOM($element->ownerDocument));
     }
     foreach ($this->_thumbnail as $thumbnail) {
         $element->appendChild($thumbnail->getDOM($element->ownerDocument));
     }
     if ($this->_copyright != null) {
         $element->appendChild(
                 $this->_copyright->getDOM($element->ownerDocument));
     }
     if ($this->_description != null) {
         $element->appendChild(
                 $this->_description->getDOM($element->ownerDocument));
     }
     foreach ($this->_hash as $hash) {
         $element->appendChild($hash->getDOM($element->ownerDocument));
     }
     if ($this->_keywords != null) {
         $element->appendChild(
                 $this->_keywords->getDOM($element->ownerDocument));
     }
     if ($this->_title != null) {
         $element->appendChild(
                 $this->_title->getDOM($element->ownerDocument));
     }
     return $element;
 }
Example #2
0
 /**
  * Sets the keyword tags for a video.
  *
  * @param mixed $tags Either a comma-separated string or an array
  * of tags for the video
  * @return \Zend\GData\YouTube\VideoEntry Provides a fluent interface
  */
 public function setVideoTags($tags)
 {
     $this->ensureMediaGroupIsNotNull();
     $keywords = new MediaExtension\MediaKeywords();
     if (is_array($tags)) {
         $tags = implode(', ', $tags);
     }
     $keywords->setText($tags);
     $this->getMediaGroup()->setKeywords($keywords);
     return $this;
 }