respect-validation/library/Respect/Validation/Exceptions/MaxException.php

25 lines
633 B
PHP
Raw Normal View History

<?php
namespace Respect\Validation\Exceptions;
class MaxException extends ValidationException
{
const INCLUSIVE = 1;
public static $defaultTemplates = array(
self::STANDARD => '%s must be lower than %s',
self::INCLUSIVE => '%s must be lower than %s (inclusive)',
);
public function cnofigure($name, $max, $inclusive)
{
return parent::configure($name, ValidationException::stringify($max),
$inclusive);//TODO find a better way
}
public function chooseTemplate($name, $max, $inclusive)
{
2011-02-07 02:12:41 +01:00
return $inclusive ? static::INCLUSIVE : static::STANDARD;
}
}