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;
|
2014-10-16 15:22:29 +02:00
|
|
|
const IDENTICAL = 1;
|
2011-01-31 01:17:06 +01:00
|
|
|
|
2010-12-07 14:37:07 +01:00
|
|
|
public static $defaultTemplates = array(
|
2011-04-10 01:34:21 +02:00
|
|
|
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}}',
|
2015-01-08 03:15:35 +01:00
|
|
|
),
|
2010-12-07 14:37:07 +01:00
|
|
|
);
|
|
|
|
|
2011-02-10 21:49:48 +01:00
|
|
|
public function chooseTemplate()
|
2010-12-07 14:37:07 +01:00
|
|
|
{
|
2011-02-10 21:49:48 +01:00
|
|
|
return $this->getParam('identical') ? static::IDENTICAL : static::EQUALS;
|
2010-12-07 14:37:07 +01:00
|
|
|
}
|
2011-02-10 21:49:48 +01:00
|
|
|
}
|