Documentation

Condition
in package

Has one that equals validator class

Tags
category

Pop

author

Nick Sagona, III dev@noladev.com

copyright

Copyright (c) 2009-2025 NOLA Interactive, LLC.

license

http://www.popphp.org/license New BSD License

version
4.5.0

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

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
Condition

createFromRule()

Create condition from rule

public static createFromRule(string $rule[, string $prefix = 'Pop\Validator\' ]) : Condition
Parameters
$rule : string
$prefix : string = 'Pop\Validator\'
Return values
Condition

evaluate()

Evaluate the condition

public evaluate(mixed $input) : bool
Parameters
$input : mixed
Tags
throws
Exception
Return values
bool

getField()

Get the condition field

public getField() : string|null
Return values
string|null

getMessage()

Get the condition message

public getMessage() : string|null
Return values
string|null

getPrefix()

Get the condition prefix

public getPrefix() : string|null
Return values
string|null

getValidator()

Get the condition validator

public getValidator() : string|null
Return values
string|null

getValue()

Get the condition value

public getValue() : mixed

hasField()

Has the condition field

public hasField() : bool
Return values
bool

hasMessage()

Has the condition message

public hasMessage() : bool
Return values
bool

hasPrefix()

Has the condition prefix

public hasPrefix() : bool
Return values
bool

hasValidator()

Has the condition validator

public hasValidator() : bool
Return values
bool

hasValidatorObject()

Has the condition validator object

public hasValidatorObject() : bool
Return values
bool

hasValue()

Has the condition value

public hasValue() : bool
Return values
bool

setField()

Set the condition field

public setField([string|null $field = null ]) : static
Parameters
$field : string|null = null
Return values
static

setMessage()

Set the condition message

public setMessage([string|null $message = null ]) : static
Parameters
$message : string|null = null
Return values
static

setPrefix()

Set the condition prefix

public setPrefix([string|null $prefix = null ]) : static
Parameters
$prefix : string|null = null
Return values
static

setValidator()

Set the condition validator

public setValidator([string|null $validator = null ]) : static
Parameters
$validator : string|null = null
Return values
static

setValue()

Set the condition value

public setValue([mixed $value = null ]) : static
Parameters
$value : mixed = null
Return values
static

        
On this page

Search results