class After extends Rule implements RuleInterface

After rule.

Traits

I18n aware trait.
Doesn't validate when empty trait.

Properties

protected I18n $i18n I18n. from I18nAwareTrait
protected string $format Date format.
protected string $date Date.
protected array $i18nParameters I18n parameters.

Methods

setI18n(I18n $i18n)

{@inheritdoc}

string
translateFieldName(string $field, string $package)

Returns a translated field name.

array
getI18nParameters(string $field, string $package)

Gets the i18n parameters.

getTranslatedErrorMessage(string $field, string $rule, string|null $package = null)

{@inheritdoc}

__construct(string $format, string $date)

Constructor.

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 41
setI18n(I18n $i18n)

{@inheritdoc}

Parameters

I18n $i18n

in I18nAwareTrait at line 55
protected string translateFieldName(string $field, string $package)

Returns a translated field name.

Parameters

string $field Field name
string $package Package prefix

Return Value

string

in I18nAwareTrait at line 76
protected array getI18nParameters(string $field, string $package)

Gets the i18n parameters.

Parameters

string $field Field name
string $package Package prefix

Return Value

array

in I18nAwareTrait at line 102
getTranslatedErrorMessage(string $field, string $rule, string|null $package = null)

{@inheritdoc}

Parameters

string $field
string $rule
string|null $package

validateWhenEmpty()

{@inheritdoc}

at line 48
__construct(string $format, string $date)

Constructor.

Parameters

string $format Date format
string $date Date

at line 58
bool validate(mixed $value, array $input)

Returns true if the rule succeeds and false if not.

Parameters

mixed $value Value to validate
array $input Input

Return Value

bool

at line 73
string getErrorMessage(string $field)

Returns an error message.

Parameters

string $field Field name

Return Value

string