equal
deleted
inserted
replaced
12 * obtain it through the world-wide-web, please send an email |
12 * obtain it through the world-wide-web, please send an email |
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Dom |
16 * @package Zend_Dom |
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
17 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 */ |
19 */ |
20 |
20 |
21 /** |
21 /** |
22 * Results for DOM XPath query |
22 * Results for DOM XPath query |
23 * |
23 * |
24 * @package Zend_Dom |
24 * @package Zend_Dom |
25 * @subpackage Query |
25 * @subpackage Query |
26 * @uses Iterator |
26 * @uses Iterator |
27 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
27 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
28 * @license http://framework.zend.com/license/new-bsd New BSD License |
28 * @license http://framework.zend.com/license/new-bsd New BSD License |
29 * @version $Id: Result.php 24593 2012-01-05 20:35:02Z matthew $ |
29 * @version $Id$ |
30 */ |
30 */ |
31 class Zend_Dom_Query_Result implements Iterator,Countable |
31 class Zend_Dom_Query_Result implements Iterator,Countable |
32 { |
32 { |
33 /** |
33 /** |
34 * Number of results |
34 * Number of results |
74 * |
74 * |
75 * @param string $cssQuery |
75 * @param string $cssQuery |
76 * @param string|array $xpathQuery |
76 * @param string|array $xpathQuery |
77 * @param DOMDocument $document |
77 * @param DOMDocument $document |
78 * @param DOMNodeList $nodeList |
78 * @param DOMNodeList $nodeList |
79 * @return void |
|
80 */ |
79 */ |
81 public function __construct($cssQuery, $xpathQuery, DOMDocument $document, DOMNodeList $nodeList) |
80 public function __construct($cssQuery, $xpathQuery, DOMDocument $document, DOMNodeList $nodeList) |
82 { |
81 { |
83 $this->_cssQuery = $cssQuery; |
82 $this->_cssQuery = $cssQuery; |
84 $this->_xpathQuery = $xpathQuery; |
83 $this->_xpathQuery = $xpathQuery; |
117 } |
116 } |
118 |
117 |
119 /** |
118 /** |
120 * Iterator: rewind to first element |
119 * Iterator: rewind to first element |
121 * |
120 * |
122 * @return void |
121 * @return DOMNode|null |
123 */ |
122 */ |
124 public function rewind() |
123 public function rewind() |
125 { |
124 { |
126 $this->_position = 0; |
125 $this->_position = 0; |
127 return $this->_nodeList->item(0); |
126 return $this->_nodeList->item(0); |
161 } |
160 } |
162 |
161 |
163 /** |
162 /** |
164 * Iterator: move to next element |
163 * Iterator: move to next element |
165 * |
164 * |
166 * @return void |
165 * @return DOMNode|null |
167 */ |
166 */ |
168 public function next() |
167 public function next() |
169 { |
168 { |
170 ++$this->_position; |
169 ++$this->_position; |
171 return $this->_nodeList->item($this->_position); |
170 return $this->_nodeList->item($this->_position); |