Different
class Different extends Rule implements RuleInterface, WithParametersInterface
Different rule.
Traits
With parameters trait.
I18n aware trait.
Doesn't validate when empty trait.
Properties
protected I18n | $i18n | I18n. | from I18nAwareTrait |
protected array | $parameters | Parameters. | |
protected array | $i18nFieldNameParameters | Parameters holding i18n field names. |
Methods
string
translateFieldName(string $field, string $package)
Returns a translated field name.
from I18nAwareTrait
array
getI18nParameters(string $field, string $package)
Gets the i18n parameters.
from I18nAwareTrait
getTranslatedErrorMessage(string $field, string $rule, string $package = null)
{@inheritdoc}
from I18nAwareTrait
mixed
getParameter(string $name, bool $optional = false)
Returns the parameter value.
from WithParametersTrait
bool
validate(mixed $value, array $input)
Returns true if the rule succeeds and false if not.
string
getErrorMessage(string $field)
Returns an error message.
Details
in I18nAwareTrait at line 39
setI18n(I18n $i18n)
{@inheritdoc}
in I18nAwareTrait at line 53
protected string
translateFieldName(string $field, string $package)
Returns a translated field name.
in I18nAwareTrait at line 74
protected array
getI18nParameters(string $field, string $package)
Gets the i18n parameters.
in I18nAwareTrait at line 100
getTranslatedErrorMessage(string $field, string $rule, string $package = null)
{@inheritdoc}
in DoesntValidateWhenEmptyTrait at line 20
validateWhenEmpty()
{@inheritdoc}
in WithParametersTrait at line 27
setParameters(array $parameters)
{@inheritdoc}
in WithParametersTrait at line 39
protected mixed
getParameter(string $name, bool $optional = false)
Returns the parameter value.
at line 41
bool
validate(mixed $value, array $input)
Returns true if the rule succeeds and false if not.
at line 49
string
getErrorMessage(string $field)
Returns an error message.