4 public function __construct($result) {
5 if(!php_Boot::$skip_constructor) {
6 $this->result = $result;
9 public function next() {
10 $»t = ($this->nextValue);
14 throw new HException("Iterator exhausted");
24 public function hasNext() {
25 return $this->nextValue != Maybe::$Nothing;
27 public function fetch() {
28 $next = db_fetch($this->result);
29 $this->nextValue = (($next) ? Maybe::Just($next) : Maybe::$Nothing);
33 public function __call($m, $a) {
34 if(isset($this->$m) && is_callable($this->$m))
35 return call_user_func_array($this->$m, $a);
36 else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
37 return call_user_func_array($this->»dynamics[$m], $a);
38 else if('toString' == $m)
39 return $this->__toString();
41 throw new HException('Unable to call «'.$m.'»');
43 function __toString() { return 'QueryIterator'; }