diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Dom/Query/Result.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Dom/Query/Result.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,183 @@ +_cssQuery = $cssQuery; + $this->_xpathQuery = $xpathQuery; + $this->_document = $document; + $this->_nodeList = $nodeList; + } + + /** + * Retrieve CSS Query + * + * @return string + */ + public function getCssQuery() + { + return $this->_cssQuery; + } + + /** + * Retrieve XPath query + * + * @return string + */ + public function getXpathQuery() + { + return $this->_xpathQuery; + } + + /** + * Retrieve DOMDocument + * + * @return DOMDocument + */ + public function getDocument() + { + return $this->_document; + } + + /** + * Iterator: rewind to first element + * + * @return void + */ + public function rewind() + { + $this->_position = 0; + return $this->_nodeList->item(0); + } + + /** + * Iterator: is current position valid? + * + * @return bool + */ + public function valid() + { + if (in_array($this->_position, range(0, $this->_nodeList->length - 1)) && $this->_nodeList->length > 0) { + return true; + } + return false; + } + + /** + * Iterator: return current element + * + * @return DOMElement + */ + public function current() + { + return $this->_nodeList->item($this->_position); + } + + /** + * Iterator: return key of current element + * + * @return int + */ + public function key() + { + return $this->_position; + } + + /** + * Iterator: move to next element + * + * @return void + */ + public function next() + { + ++$this->_position; + return $this->_nodeList->item($this->_position); + } + + /** + * Countable: get count + * + * @return int + */ + public function count() + { + return $this->_nodeList->length; + } +}