{$field})){ return $this->{$field}; } return NULL; } function setFields($fields){ foreach($fields as $key => $val){ $this->{$key} = $val; } } function setError($field, $error){ $this->errors[$field] = $error; } function getError($field){ if(isset($this->errors[$field])){ return $this->errors[$field]; } } function hasError($field){ return isset($this->errors[$field]); } function hasErrors(){ return (count($this->errors) > 0); } } ?>