getAttribute('rel')) !== 'alternate' || !$link->getAttribute('type') || !$link->getAttribute('href')) { continue; } if (!isset($this->rss) && $link->getAttribute('type') == 'application/rss+xml') { $this->rss = trim($link->getAttribute('href')); } elseif(!isset($this->atom) && $link->getAttribute('type') == 'application/atom+xml') { $this->atom = trim($link->getAttribute('href')); } elseif(!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') { $this->rdf = trim($link->getAttribute('href')); } $this[] = new self(array( 'rel' => 'alternate', 'type' => $link->getAttribute('type'), 'href' => trim($link->getAttribute('href')), )); } } /** * Supports lazy loading of feeds using Zend_Feed_Reader::import() but * delegates any other operations to the parent class. * * @param string $offset * @return mixed * @uses Zend_Feed_Reader */ public function offsetGet($offset) { if ($offset == 'feed' && !$this->offsetExists('feed')) { if (!$this->offsetExists('href')) { return null; } $feed = Zend_Feed_Reader::import($this->offsetGet('href')); $this->offsetSet('feed', $feed); return $feed; } return parent::offsetGet($offset); } }