10 defined(
'JPATH_PLATFORM') or die;
67 private $_fetched = 0;
78 public function __construct($cursor, $column = null, $class =
'stdClass')
80 if (!class_exists($class))
82 throw new InvalidArgumentException(sprintf(
'new %s(*%s*, cursor)', get_class($this), gettype($class)));
85 $this->cursor = $cursor;
86 $this->
class = $class;
87 $this->_column = $column;
97 public function __destruct()
101 $this->freeResult($this->cursor);
113 public function current()
115 return $this->_current;
126 public function key()
139 public function next()
142 $this->_key = $this->_fetched;
145 $this->_current = $this->fetchObject();
151 if (isset($this->_current->{$this->_column}))
153 $this->_key = $this->_current->{$this->_column};
171 public function rewind()
183 public function valid()
185 return (
boolean) $this->_current;
195 abstract protected function fetchObject();
204 abstract protected function freeResult();