Ejemplo n.º 1
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gd') . ':' . 'feedLink';
             $feedLink = new FeedLink();
             $feedLink->transferFromDOM($child);
             $this->_feedLink = $feedLink;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Ejemplo n.º 2
0
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->feedLink->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->feedLink->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->feedLink->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->feedLink->extensionAttributes['foo2']['value']);
     $feedLinkXml = $this->feedLink->saveXML();
     $newFeedLink = new Extension\FeedLink();
     $newFeedLink->transferFromXML($feedLinkXml);
     $this->assertEquals('bar', $newFeedLink->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newFeedLink->extensionAttributes['foo2']['value']);
 }
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') . ':' . 'statistics':
             $statistics = new Extension\Statistics();
             $statistics->transferFromDOM($child);
             $this->_statistics = $statistics;
             break;
         case $this->lookupNamespace('yt') . ':' . 'racy':
             $racy = new GDataExtension\Racy();
             $racy->transferFromDOM($child);
             $this->_racy = $racy;
             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 \Zend\GData\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;
     }
 }