3
* KumbiaPHP web & app Framework
7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://wiki.kumbiaphp.com/Licencia
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@kumbiaphp.com so we can send you a copy immediately.
15
* Resultado de una consulta con ActiveRecord
19
* @copyright Copyright (c) 2005-2010 KumbiaPHP Team (http://www.kumbiaphp.com)
20
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
22
class ResultSet implements Iterator
25
* Resultado de la consulta
33
private $_position = 0;
38
public function __construct ($result)
40
$this->_result = $result;
47
public function fetchArray ()
49
return $this->_result->fetchAll(PDO::FETCH_ASSOC);
57
public function fetchObject ($class = 'stdClass')
59
return $this->_result->fetchObject($class);
67
public function fetchAll($fetch=PDO::FETCH_OBJ)
69
return $this->_result->fetchAll($fetch);
72
* Cantidad de filas afectadas por la sentencia
76
public function affectRows ()
78
return $this->_result->rowCount();
81
* reset result set pointer
82
* (implementation required by 'rewind()' method in Iterator interface)
84
public function rewind ()
89
* get current row set in result set
90
* (implementation required by 'current()' method in Iterator interface)
92
public function current ()
94
if (! $this->valid()) {
95
throw new KumbiaException('Unable to retrieve current row.');
97
return $this->fetchObject();
100
* Obtiene la posición actual del Puntero
103
public function key ()
105
return $this->_pointer;
108
* Mueve el puntero a la siguiente posición
111
public function next ()
116
* Determina si el puntero del ResultSet es valido
119
public function valid ()
121
return $this->_pointer < $this->_result->rowCount();
b'\\ No newline at end of file'