\FieldChecker

Field Checker

Use to check if input data is correct

Summary

Methods
Properties
Constants
__construct()
set()
get()
getRules()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
strCheck()
$rules
$data
N/A

Properties

$rules

$rules : array|mixed

Type

array|mixed — Used check-rules

$data

$data : mixed

Type

mixed — Data to check

Methods

__construct()

__construct(array<mixed,mixed>  $r) : boolean

Set rules

Sets rules for FieldChecker object

Parameters

array<mixed,mixed> $r

Rules to check

  • min - (int) MIN str length
  • max - (int) MAX str length
  • regex - (str) RegExp to check
  • symbols - (str) Allowed symbols (/^([{SYMBOLS}]+)?$/)
  • numeric - (bool) Is numeric
  • range - Allowed range for numeric values
  • isint - Check if the value is strictly Integer

Returns

boolean

set()

set(mixed  $q) : boolean

Check

Applies and saves a value to the object with checking

Parameters

mixed $q

The value

Throws

\apiException
  • [107] Check failed

Returns

boolean

get()

get() : mixed

Get

Get the saved string

Returns

mixed

getRules()

getRules() : array<mixed,mixed>

Get rules

Get saved rules

Returns

array<mixed,mixed>

strCheck()

strCheck(integer|string  $q) : boolean

Check string

Checks the string

Parameters

integer|string $q

Data to check

Returns

boolean