Class DivisibleBy
Check if the input could be divisible by specified divisor
-
Wei\Base
-
Wei\Validator\BaseValidator
-
Wei\Validator\DivisibleBy
Methods summary
public
boolean
|
#
__invoke( mixed $input, $divisor = null )
Validate the input value
Parameters
Returns
boolean
Overrides
|
protected
boolean
|
#
doValidate( mixed $input )
Validate the input value (ignore the $negative property)
Validate the input value (ignore the $negative property)
Parameters
- $input
- The input to be validated
Returns
boolean
|
Methods inherited from Wei\Validator\BaseValidator
addError(),
getErrors(),
getFirstMessage(),
getJoinedMessage(),
getMessages(),
getName(),
hasError(),
isString(),
isValid(),
loadTranslationMessages(),
setMessages(),
setName(),
storeOption()
|
Properties summary
protected
string
|
$notDivisibleMessage
|
#
'%name% must be divisible by %divisor%'
|
protected
string
|
$negativeMessage
The common message for negative validator
The common message for negative validator
|
#
'%name% must not be divisible by %divisor%'
|
protected
integer|float
|
$divisor
Set divisor to 1 to avoid "division by zero" error
Set divisor to 1 to avoid "division by zero" error
|
|