inc\classes\FieldChecker.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
FieldChecker

Checks strings

Author
Sergey Dilong  
License
GPL-2.0  
Package
Temply-Account\Core  

\FieldChecker

Package: Temply-Account\Core
Field Checker

Use to check if input data is correct

Author
Sergey Dilong  
License
GPL-2.0  

Properties

>VPropertyprivatemixed $data = false

Data to check

Default valuefalseDetails
Type
mixed
>VPropertyprivatearray|mixed $rules = false

Used check-rules

Default valuefalseDetails
Type
array | mixed

Methods

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

Set rules

Sets rules for FieldChecker object

Parameters
NameTypeDescription
$rarray<mixed,mixed>

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
TypeDescription
boolean
methodpublicget() : mixed

Get

Get the saved string

Returns
TypeDescription
mixed
methodpublicgetRules() : array<mixed,mixed>

Get rules

Get saved rules

Returns
TypeDescription
array<mixed,mixed>
methodpublicset(mixed $q) : boolean

Check

Applies and saves a value to the object with checking

Parameters
NameTypeDescription
$qmixed

The value

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\apiException* [107] Check failed
methodprivatestrCheck(integer | string $q) : boolean

Check string

Checks the string

Parameters
NameTypeDescription
$qinteger | string

Data to check

Returns
TypeDescription
boolean
Details
See
Call this function outside the class  
Documentation was generated by phpDocumentor v2.9.0.