Exemplo 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->_noEmbed != null) {
         $element->appendChild($this->_noEmbed->getDOM($element->ownerDocument));
     }
     if ($this->_statistics != null) {
         $element->appendChild($this->_statistics->getDOM($element->ownerDocument));
     }
     if ($this->_recorded != null) {
         $element->appendChild($this->_recorded->getDOM($element->ownerDocument));
     }
     if ($this->_location != null) {
         $element->appendChild($this->_location->getDOM($element->ownerDocument));
     }
     if ($this->_rating != null) {
         $element->appendChild($this->_rating->getDOM($element->ownerDocument));
     }
     if ($this->_comments != null) {
         $element->appendChild($this->_comments->getDOM($element->ownerDocument));
     }
     if ($this->_feedLink != null) {
         foreach ($this->_feedLink as $feedLink) {
             $element->appendChild($feedLink->getDOM($element->ownerDocument));
         }
     }
     if ($this->_where != null) {
         $element->appendChild($this->_where->getDOM($element->ownerDocument));
     }
     return $element;
 }
Exemplo n.º 2
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') . ':' . '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 \ZendGData\Media\Extension\MediaThumbnail();
             $thumbnail->transferFromDOM($child);
             $this->_thumbnail = $thumbnail;
             break;
         case $this->lookupNamespace('gd') . ':' . 'feedLink':
             $feedLink = new \ZendGData\Extension\FeedLink();
             $feedLink->transferFromDOM($child);
             $this->_feedLink[] = $feedLink;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Exemplo 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') . ':' . 'statistics':
             $statistics = new Extension\Statistics();
             $statistics->transferFromDOM($child);
             $this->_statistics = $statistics;
             break;
         case $this->lookupNamespace('yt') . ':' . 'recorded':
             $recorded = new Extension\Recorded();
             $recorded->transferFromDOM($child);
             $this->_recorded = $recorded;
             break;
         case $this->lookupNamespace('yt') . ':' . 'location':
             $location = new Extension\Location();
             $location->transferFromDOM($child);
             $this->_location = $location;
             break;
         case $this->lookupNamespace('gd') . ':' . 'rating':
             $rating = new GDataExtension\Rating();
             $rating->transferFromDOM($child);
             $this->_rating = $rating;
             break;
         case $this->lookupNamespace('gd') . ':' . 'comments':
             $comments = new GDataExtension\Comments();
             $comments->transferFromDOM($child);
             $this->_comments = $comments;
             break;
         case $this->lookupNamespace('yt') . ':' . 'noembed':
             $noEmbed = new Extension\NoEmbed();
             $noEmbed->transferFromDOM($child);
             $this->_noEmbed = $noEmbed;
             break;
         case $this->lookupNamespace('gd') . ':' . 'feedLink':
             $feedLink = new GDataExtension\FeedLink();
             $feedLink->transferFromDOM($child);
             $this->_feedLink[] = $feedLink;
             break;
         case $this->lookupNamespace('georss') . ':' . 'where':
             $where = new \ZendGData\Geo\Extension\GeoRssWhere();
             $where->transferFromDOM($child);
             $this->_where = $where;
             break;
         case $this->lookupNamespace('atom') . ':' . 'link':
             $link = new Extension\Link();
             $link->transferFromDOM($child);
             $this->_link[] = $link;
             break;
         case $this->lookupNamespace('app') . ':' . 'control':
             $control = new Extension\Control();
             $control->transferFromDOM($child);
             $this->_control = $control;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }