\Omega\Validation\Rule RuleInterface

RuleInterface.

The RuleInterface defines the contract that validation rules in Omega must adhere to.

Summary

Methods
Constants
validate()
getMessage()
No public constants found

Methods

validate()

validate(array  $data, string  $field, string[]  $params) : string|bool

Validate the rule.

Parameters

array $data

Holds array of data.

string $field

Holds the name of the field being validated.

string[] $params

Holds an array of parameters (not used for this rule).

Returns

string|bool —

Returns true if validation is successful (valid integer format), or an error message if the validation fails.

getMessage()

getMessage(array  $data, string  $field, string[]  $params) : string

Get the validation error message.

Parameters

array $data

Holds an array of data.

string $field

Holds the name of the field that failed validation.

string[] $params

Holds an array of parameters (not used for this rule).

Returns

string —

Returns the error message indicating that the field should be in a valid integer format.