Arikaim CMS

Text extends Rule
in package

Text field rule

Table of Contents

Constants

BOOLEAN_TYPE  = 4
FLOAT_TYPE  = 3
INTEGER_TYPE  = 1
ITEMS_ARRAY  = 6
NUMBER_TYPE  = 5
STRING_TYPE  = 2

Properties

$defaultError  : string|null
Default errror code
$error  : string|null
Rule error
$errorParams  : array<string|int, mixed>
Error params
$params  : Collection
Rule params

Methods

__construct()  : mixed
Constructor
getError()  : string|null
Return validation error code
getErrorParams()  : array<string|int, mixed>
Get error params
getParams()  : Collection
Return rule params
getType()  : mixed
Return filter type
isRequired()  : bool
Return true if field rule is required
required()  : void
Set rule required
setDefaultError()  : void
Set default error code
setError()  : void
Set validation error ode
setErrorParams()  : void
Set error params
validate()  : bool
Verify if value is valid
validateType()  : bool
Validate field type

Constants

BOOLEAN_TYPE

public mixed BOOLEAN_TYPE = 4

FLOAT_TYPE

public mixed FLOAT_TYPE = 3

INTEGER_TYPE

public mixed INTEGER_TYPE = 1

ITEMS_ARRAY

public mixed ITEMS_ARRAY = 6

NUMBER_TYPE

public mixed NUMBER_TYPE = 5

STRING_TYPE

public mixed STRING_TYPE = 2

Properties

$defaultError

Default errror code

protected string|null $defaultError = null

$error

Rule error

protected string|null $error = null

$errorParams

Error params

protected array<string|int, mixed> $errorParams = []

Methods

__construct()

Constructor

public __construct([array<string|int, mixed> $params = [] ][, string|null $error = null ]) : mixed
Parameters
$params : array<string|int, mixed> = []
$error : string|null = null

getError()

Return validation error code

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

getErrorParams()

Get error params

public getErrorParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getType()

Return filter type

public getType() : mixed

isRequired()

Return true if field rule is required

public isRequired() : bool
Return values
bool

required()

Set rule required

public required([bool $value = true ]) : void
Parameters
$value : bool = true

setDefaultError()

Set default error code

public setDefaultError(string $errorCode) : void
Parameters
$errorCode : string

setError()

Set validation error ode

public setError(string|null $error[, string|null $default = null ]) : void
Parameters
$error : string|null
$default : string|null = null

setErrorParams()

Set error params

public setErrorParams([array<string|int, mixed> $params = [] ]) : void
Parameters
$params : array<string|int, mixed> = []

validate()

Verify if value is valid

public validate(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

validateType()

Validate field type

protected validateType(mixed $value, int $type) : bool
Parameters
$value : mixed
$type : int
Return values
bool

        
On this page

Search results