| | 400 | * Add or overwrite description of an error to the list of errors |
| | 401 | * @param string $error Error message text |
| | 402 | * @param string $key Key to associate with the error (in the |
| | 403 | * simple case, column name). If omitted, numeric keys will be |
| | 404 | * assigned starting with 0. If specified and the key already |
| | 405 | * exists in $errors, the old error message will be overwritten |
| | 406 | * with the value of $error. |
| | 407 | * @uses $errors |
| | 408 | */ |
| | 409 | function add_error($error, $key = null) { |
| | 410 | if(!is_null($key)) { |
| | 411 | $this->errors[$key] = $error; |
| | 412 | } else { |
| | 413 | $this->errors[] = $error; |
| | 414 | } |
| | 415 | } |
| | 416 | |
| | 417 | /** |