public function fetchAll() {
    $results = array();
    $result = $this->next();
    while($result !== null) {
      $results = array_merge($results,$result);
      $result = $this->next();
    }
    return $results;
  }