respect-validation/library/Exceptions/EqualsException.php

26 lines
734 B
PHP
Raw Normal View History

2010-12-07 14:37:07 +01:00
<?php
2015-06-08 16:47:14 +02:00
2010-12-07 14:37:07 +01:00
namespace Respect\Validation\Exceptions;
class EqualsException extends ValidationException
{
2011-02-07 02:12:41 +01:00
const EQUALS = 0;
const IDENTICAL = 1;
2010-12-07 14:37:07 +01:00
public static $defaultTemplates = array(
self::MODE_DEFAULT => array(
self::EQUALS => '{{name}} must be equals {{compareTo}}',
self::IDENTICAL => '{{name}} must be identical as {{compareTo}}',
),
self::MODE_NEGATIVE => array(
self::EQUALS => '{{name}} must not be equals {{compareTo}}',
self::IDENTICAL => '{{name}} must not be identical as {{compareTo}}',
),
2010-12-07 14:37:07 +01:00
);
public function chooseTemplate()
2010-12-07 14:37:07 +01:00
{
return $this->getParam('identical') ? static::IDENTICAL : static::EQUALS;
2010-12-07 14:37:07 +01:00
}
}