_uri = $uri; if (is_null($httpClient)) { $httpClient = new Horde_Http_Client(); } $this->_httpClient = $httpClient; try { parent::__construct($xml); } catch (Horde_Xml_Element_Exception $e) { throw new Horde_Feed_Exception('Unable to load feed: ' . $e->getMessage()); } } /** * Handle null or array values for $this->_element by initializing * with $this->_emptyXml, and importing the array with * Horde_Xml_Element::fromArray() if necessary. * * @see Horde_Xml_Element::__wakeup * @see Horde_Xml_Element::fromArray */ public function __wakeup() { // If we've been passed an array, we'll store it for importing // after initializing with the default "empty" feed XML. $importArray = null; if (is_null($this->_element)) { $this->_element = $this->_emptyXml; } elseif (is_array($this->_element)) { $importArray = $this->_element; $this->_element = $this->_emptyXml; } parent::__wakeup(); if (!is_null($importArray)) { $this->fromArray($importArray); } } /** * Required by the Iterator interface. * * @internal * * @return mixed The current row, or null if no rows. */ public function current() { return new $this->_listItemClassName( $this->_listItems[$this->_listItemIndex], $this->_httpClient); } }