Ejemplo n.º 1
0
 /**
  * Make accessing individual elements of the feed easier.
  *
  * @param string $var The property to access.
  */
 public function __get($var)
 {
     switch ($var) {
         case 'entry':
             // fall through to the next case
         // fall through to the next case
         case 'entries':
             // fall through to the next case
         // fall through to the next case
         case 'item':
             // fall through to the next case
         // fall through to the next case
         case 'items':
             return $this;
         case 'service.feed':
             // fall through to the next case
         // fall through to the next case
         case 'service.post':
             foreach ($this->_element->childNodes as $child) {
                 if ($child->localName == 'link' && $child->getAttribute('rel') == $var) {
                     return $child->getAttribute('href');
                 }
             }
             return null;
         default:
             return parent::__get($var);
     }
 }