Files
homepage/code/validation/range_validator.php
Ben Roberts 46cd0f0c98 Ready to upload to benroberts.net/ecs
tidied up unneeded files, played with css
added an empty projects page.
removed the cv page and instead hyperlinked directly to .pdf
2008-04-21 01:27:18 +00:00

41 lines
704 B
PHP

<?php
/*
*
*
*/
class RangeValidator implements IValidator {
private $min;
private $max;
public function __construct($min, $max) {
}
public static function initialise() {
// Nothing to do
}
public static function shutdown() {
// Nothing to do
}
public function associate() {
// Nothing to do
}
public function disassociate() {
// Nothing to do
}
public function validate($input) {
if( $input < $min || $input > $max )
throw new ValidationException("Input is no in the range {$this->min}-{$this->max}");
}
};
?>