count() > 0) { $d->rewind(); $firstRow = $d->current()->toArray(); $this->columns = array_keys($firstRow); //Note: foreach resets array iterator pointer foreach($d as $row) { $this->rows[] = array_values($row->toArray()); } } } } ? >