record = $record; $this->columns = $record->getTable()->getColumns(); $this->keys = array_keys($this->columns); $this->index = 0; $this->count = count($this->keys); } public function current() { $i = $this->index; $column = $this->keys[$i]; $definitions = $this->columns[$column]; $e = explode("|",$definitions[2]); $enum = false; if($definitions[0] == "enum") $enum = $this->record->getTable()->getEnumValues($column); $length = $definitions[1]; if( ! in_array("autoincrement",$e) && ! in_array("protected",$e)) { if($enum) { $elements[$column] = "\n"; } else { if($length <= 255) { $elements[$column] = "\n"; } elseif($length <= 4000) { $elements[$column] = "\n"; } else { $elements[$column] = "\n"; } } return $elements[$column]; } else { $this->index++; if($this->index < $this->count) return self::current(); } } public function key() { $i = $this->index; return $this->keys[$i]; } public function next() { $this->index++; } public function rewind() { $this->index = 0; } public function valid() { if($this->index >= $this->count) return false; return true; } } ?>