Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them as members of this entry 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('yt') . ':' . 'videoid':
             $videoId = new Extension\VideoId();
             $videoId->transferFromDOM($child);
             $this->_videoId = $videoId;
             break;
         case $this->lookupNamespace('yt') . ':' . 'username':
             $username = new Extension\Username();
             $username->transferFromDOM($child);
             $this->_username = $username;
             break;
         case $this->lookupNamespace('gd') . ':' . 'rating':
             $rating = new \Zend\GData\Extension\Rating();
             $rating->transferFromDOM($child);
             $this->_rating = $rating;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }