Ejemplo n.º 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);
     if ($this->_description != null) {
         $element->appendChild($this->_description->getDOM($element->ownerDocument));
     }
     if ($this->_rating != null) {
         $element->appendChild($this->_rating->getDOM($element->ownerDocument));
     }
     if ($this->_statistics != null) {
         $element->appendChild($this->_statistics->getDOM($element->ownerDocument));
     }
     if ($this->_comments != null) {
         $element->appendChild($this->_comments->getDOM($element->ownerDocument));
     }
     return $element;
 }
Ejemplo n.º 2
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);
     if ($this->_description != null) {
         $element->appendChild($this->_description->getDOM($element->ownerDocument));
     }
     if ($this->_countHint != null) {
         $element->appendChild($this->_countHint->getDOM($element->ownerDocument));
     }
     if ($this->_playlistId != null) {
         $element->appendChild($this->_playlistId->getDOM($element->ownerDocument));
     }
     if ($this->_feedLink != null) {
         foreach ($this->_feedLink as $feedLink) {
             $element->appendChild($feedLink->getDOM($element->ownerDocument));
         }
     }
     return $element;
 }
Ejemplo n.º 3
0
 /**
  * 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('yt') . ':' . 'description':
             $description = new Extension\Description();
             $description->transferFromDOM($child);
             $this->_description = $description;
             break;
         case $this->lookupNamespace('yt') . ':' . 'aboutMe':
             $aboutMe = new Extension\AboutMe();
             $aboutMe->transferFromDOM($child);
             $this->_aboutMe = $aboutMe;
             break;
         case $this->lookupNamespace('yt') . ':' . 'age':
             $age = new Extension\Age();
             $age->transferFromDOM($child);
             $this->_age = $age;
             break;
         case $this->lookupNamespace('yt') . ':' . 'username':
             $username = new Extension\Username();
             $username->transferFromDOM($child);
             $this->_username = $username;
             break;
         case $this->lookupNamespace('yt') . ':' . 'books':
             $books = new Extension\Books();
             $books->transferFromDOM($child);
             $this->_books = $books;
             break;
         case $this->lookupNamespace('yt') . ':' . 'company':
             $company = new Extension\Company();
             $company->transferFromDOM($child);
             $this->_company = $company;
             break;
         case $this->lookupNamespace('yt') . ':' . 'hobbies':
             $hobbies = new Extension\Hobbies();
             $hobbies->transferFromDOM($child);
             $this->_hobbies = $hobbies;
             break;
         case $this->lookupNamespace('yt') . ':' . 'hometown':
             $hometown = new Extension\Hometown();
             $hometown->transferFromDOM($child);
             $this->_hometown = $hometown;
             break;
         case $this->lookupNamespace('yt') . ':' . 'location':
             $location = new Extension\Location();
             $location->transferFromDOM($child);
             $this->_location = $location;
             break;
         case $this->lookupNamespace('yt') . ':' . 'movies':
             $movies = new Extension\Movies();
             $movies->transferFromDOM($child);
             $this->_movies = $movies;
             break;
         case $this->lookupNamespace('yt') . ':' . 'music':
             $music = new Extension\Music();
             $music->transferFromDOM($child);
             $this->_music = $music;
             break;
         case $this->lookupNamespace('yt') . ':' . 'occupation':
             $occupation = new Extension\Occupation();
             $occupation->transferFromDOM($child);
             $this->_occupation = $occupation;
             break;
         case $this->lookupNamespace('yt') . ':' . 'school':
             $school = new Extension\School();
             $school->transferFromDOM($child);
             $this->_school = $school;
             break;
         case $this->lookupNamespace('yt') . ':' . 'gender':
             $gender = new Extension\Gender();
             $gender->transferFromDOM($child);
             $this->_gender = $gender;
             break;
         case $this->lookupNamespace('yt') . ':' . 'relationship':
             $relationship = new Extension\Relationship();
             $relationship->transferFromDOM($child);
             $this->_relationship = $relationship;
             break;
         case $this->lookupNamespace('yt') . ':' . 'firstName':
             $firstName = new Extension\FirstName();
             $firstName->transferFromDOM($child);
             $this->_firstName = $firstName;
             break;
         case $this->lookupNamespace('yt') . ':' . 'lastName':
             $lastName = new Extension\LastName();
             $lastName->transferFromDOM($child);
             $this->_lastName = $lastName;
             break;
         case $this->lookupNamespace('yt') . ':' . 'statistics':
             $statistics = new Extension\Statistics();
             $statistics->transferFromDOM($child);
             $this->_statistics = $statistics;
             break;
         case $this->lookupNamespace('media') . ':' . 'thumbnail':
             $thumbnail = new \Zend\GData\Media\Extension\MediaThumbnail();
             $thumbnail->transferFromDOM($child);
             $this->_thumbnail = $thumbnail;
             break;
         case $this->lookupNamespace('gd') . ':' . 'feedLink':
             $feedLink = new \Zend\GData\Extension\FeedLink();
             $feedLink->transferFromDOM($child);
             $this->_feedLink[] = $feedLink;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Ejemplo n.º 4
0
 /**
  * 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('yt') . ':' . 'description':
             $description = new Extension\Description();
             $description->transferFromDOM($child);
             $this->_description = $description;
             break;
         case $this->lookupNamespace('yt') . ':' . 'countHint':
             $countHint = new Extension\CountHint();
             $countHint->transferFromDOM($child);
             $this->_countHint = $countHint;
             break;
         case $this->lookupNamespace('yt') . ':' . 'playlistId':
             $playlistId = new Extension\PlaylistId();
             $playlistId->transferFromDOM($child);
             $this->_playlistId = $playlistId;
             break;
         case $this->lookupNamespace('gd') . ':' . 'feedLink':
             $feedLink = new \Zend\GData\Extension\FeedLink();
             $feedLink->transferFromDOM($child);
             $this->_feedLink[] = $feedLink;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Ejemplo n.º 5
0
 /**
  * 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('gd') . ':' . 'comments':
             $comments = new \Zend\GData\Extension\Comments();
             $comments->transferFromDOM($child);
             $this->_comments = $comments;
             break;
         case $this->lookupNamespace('gd') . ':' . 'rating':
             $rating = new \Zend\GData\Extension\Rating();
             $rating->transferFromDOM($child);
             $this->_rating = $rating;
             break;
         case $this->lookupNamespace('yt') . ':' . 'description':
             $description = new Extension\Description();
             $description->transferFromDOM($child);
             $this->_description = $description;
             break;
         case $this->lookupNamespace('yt') . ':' . 'statistics':
             $statistics = new Extension\Statistics();
             $statistics->transferFromDOM($child);
             $this->_statistics = $statistics;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }