Condition
in package
Has one that equals validator class
Tags
Table of Contents
Properties
- $field : string|null
- Field
- $message : string|null
- Message
- $prefix : string|null
- Prefix
- $validator : string|null
- Validator
- $validatorObject : AbstractValidator|null
- Validator
- $value : mixed
- Value
Methods
- __construct() : mixed
- Constructor
- create() : Condition
- Create condition
- createFromRule() : Condition
- Create condition from rule
- evaluate() : bool
- Evaluate the condition
- getField() : string|null
- Get the condition field
- getMessage() : string|null
- Get the condition message
- getPrefix() : string|null
- Get the condition prefix
- getValidator() : string|null
- Get the condition validator
- getValidatorObject() : AbstractValidator|null
- Get the condition validator object
- getValue() : mixed
- Get the condition value
- hasField() : bool
- Has the condition field
- hasMessage() : bool
- Has the condition message
- hasPrefix() : bool
- Has the condition prefix
- hasValidator() : bool
- Has the condition validator
- hasValidatorObject() : bool
- Has the condition validator object
- hasValue() : bool
- Has the condition value
- setField() : static
- Set the condition field
- setMessage() : static
- Set the condition message
- setPrefix() : static
- Set the condition prefix
- setValidator() : static
- Set the condition validator
- setValue() : static
- Set the condition value
Properties
$field
Field
protected
string|null
$field
= null
$message
Message
protected
string|null
$message
= null
$prefix
Prefix
protected
string|null
$prefix
= null
$validator
Validator
protected
string|null
$validator
= null
$validatorObject
Validator
protected
AbstractValidator|null
$validatorObject
= null
$value
Value
protected
mixed
$value
= null
Methods
__construct()
Constructor
public
__construct([string|null $field = null ][, string|null $validator = null ][, mixed $value = null ][, string|null $message = null ][, string|null $prefix = 'Pop\Validator\' ]) : mixed
Instantiate the condition object
Parameters
- $field : string|null = null
- $validator : string|null = null
- $value : mixed = null
- $message : string|null = null
- $prefix : string|null = 'Pop\Validator\'
create()
Create condition
public
static create([string|null $field = null ][, string|null $validator = null ][, mixed $value = null ][, string|null $message = null ][, string|null $prefix = 'Pop\Validator\' ]) : Condition
Parameters
- $field : string|null = null
- $validator : string|null = null
- $value : mixed = null
- $message : string|null = null
- $prefix : string|null = 'Pop\Validator\'
Return values
ConditioncreateFromRule()
Create condition from rule
public
static createFromRule(string $rule[, string $prefix = 'Pop\Validator\' ]) : Condition
Parameters
- $rule : string
- $prefix : string = 'Pop\Validator\'
Return values
Conditionevaluate()
Evaluate the condition
public
evaluate(mixed $input) : bool
Parameters
- $input : mixed
Tags
Return values
boolgetField()
Get the condition field
public
getField() : string|null
Return values
string|nullgetMessage()
Get the condition message
public
getMessage() : string|null
Return values
string|nullgetPrefix()
Get the condition prefix
public
getPrefix() : string|null
Return values
string|nullgetValidator()
Get the condition validator
public
getValidator() : string|null
Return values
string|nullgetValidatorObject()
Get the condition validator object
public
getValidatorObject() : AbstractValidator|null
Return values
AbstractValidator|nullgetValue()
Get the condition value
public
getValue() : mixed
hasField()
Has the condition field
public
hasField() : bool
Return values
boolhasMessage()
Has the condition message
public
hasMessage() : bool
Return values
boolhasPrefix()
Has the condition prefix
public
hasPrefix() : bool
Return values
boolhasValidator()
Has the condition validator
public
hasValidator() : bool
Return values
boolhasValidatorObject()
Has the condition validator object
public
hasValidatorObject() : bool
Return values
boolhasValue()
Has the condition value
public
hasValue() : bool
Return values
boolsetField()
Set the condition field
public
setField([string|null $field = null ]) : static
Parameters
- $field : string|null = null
Return values
staticsetMessage()
Set the condition message
public
setMessage([string|null $message = null ]) : static
Parameters
- $message : string|null = null
Return values
staticsetPrefix()
Set the condition prefix
public
setPrefix([string|null $prefix = null ]) : static
Parameters
- $prefix : string|null = null
Return values
staticsetValidator()
Set the condition validator
public
setValidator([string|null $validator = null ]) : static
Parameters
- $validator : string|null = null
Return values
staticsetValue()
Set the condition value
public
setValue([mixed $value = null ]) : static
Parameters
- $value : mixed = null