2010-12-06 02:17:12 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Respect\Validation\Exceptions;
|
|
|
|
|
2011-01-31 01:17:06 +01:00
|
|
|
class AttributeException extends AbstractRelatedException
|
2010-12-06 02:17:12 +01:00
|
|
|
{
|
2011-01-31 01:17:06 +01:00
|
|
|
|
2010-12-06 02:17:12 +01:00
|
|
|
public static $defaultTemplates = array(
|
2011-01-31 01:17:06 +01:00
|
|
|
'"%2$s" is not present',
|
|
|
|
'"%2$s" is invalid',
|
2010-12-06 02:17:12 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
public function chooseTemplate($input, $attributeName, $hasTheAttribute)
|
|
|
|
{
|
|
|
|
if (!$hasTheAttribute)
|
2011-01-31 01:17:06 +01:00
|
|
|
return 0;
|
2010-12-06 02:17:12 +01:00
|
|
|
else
|
2011-01-31 01:17:06 +01:00
|
|
|
return 1;
|
2010-12-06 02:17:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|