TimeTrex API Manual

Validator
in package

Table of Contents

$validate_only  : mixed
$errors  : mixed
$num_errors  : mixed
$num_warnings  : mixed
$verbosity  : mixed
$warnings  : mixed
Error()  : bool
escapeHTML()  : string
getErrors()  : bool|string
getErrorsAndWarningsArray()  : array<string|int, mixed>
Returns both Errors and Warnings combined.
getErrorsArray()  : array<string|int, mixed>
getPhoneNumberAreaCode()  : bool|string
getTextErrors()  : bool|string
getValidateOnly()  : bool
getWarningsArray()  : array<string|int, mixed>
hasError()  : bool
hasWarning()  : bool
inArrayKey()  : bool
inArrayValue()  : bool
isAllowedValues()  : bool
isAllowedWords()  : bool
isAlphaNumeric()  : bool
isDate()  : bool
isDigits()  : bool
isDuplicateCharacters()  : bool
isEmail()  : bool
isEmailAdvanced()  : bool
isError()  : bool
isFalse()  : bool
isFloat()  : bool
isGreaterThan()  : bool
isIPAddress()  : bool
isLength()  : bool
isLengthAfterDecimal()  : bool
isLengthBeforeDecimal()  : bool
isLessThan()  : bool
isNotNull()  : bool
isNotRegEx()  : bool
isNotResultSetWithRows()  : bool
isNull()  : bool
isNumeric()  : bool
isPhoneNumber()  : bool
isPostalCode()  : bool
isRegEx()  : bool
isResultSetWithRows()  : bool
Checks a result set for one or more rows.
isSIN()  : bool
isTrue()  : bool
Function to simple set an error.
isUniqueCharacters()  : bool
isUUID()  : bool
isValid()  : bool
isWarning()  : bool
merge()  : bool
Merges all errors/warnings from the passed $validator object to this one.
purifyHTML()  : string
resetErrors()  : bool
resetWarnings()  : bool
setValidateOnly()  : mixed
stripHTML()  : string
stripNon32bitInteger()  : int
stripNonAlphaNumeric()  : mixed
stripNonFloat()  : int|float|string
stripNonNumeric()  : mixed
stripNonTimeUnit()  : mixed
Suitable for passing to parseTimeUnit() after.
stripNumeric()  : mixed
stripSpaces()  : mixed
varReplace()  : mixed
Warning()  : bool
addRecordLabelPrefixToArray()  : array<string|int, mixed>

Properties

Methods

Error()

public Error( $label,  $msg[, string $value = '' ]) : bool
Parameters
$label :
$msg :
$value : string = ''
Return values
bool

escapeHTML()

public escapeHTML( $value) : string
Parameters
$value :
Return values
string

getErrors()

public getErrors() : bool|string
Return values
bool|string

getErrorsAndWarningsArray()

Returns both Errors and Warnings combined.

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

getErrorsArray()

public getErrorsArray([string $record_label_prefix = null ]) : array<string|int, mixed>
Parameters
$record_label_prefix : string = null
Return values
array<string|int, mixed>

getPhoneNumberAreaCode()

public getPhoneNumberAreaCode( $value) : bool|string
Parameters
$value :
Return values
bool|string

getTextErrors()

public getTextErrors([bool $numbered_list = true ][, array<string|int, mixed> $errors_arr = null ]) : bool|string
Parameters
$numbered_list : bool = true
$errors_arr : array<string|int, mixed> = null

Pass in other error array to be converted to text.

Return values
bool|string

getValidateOnly()

public getValidateOnly() : bool
Return values
bool

getWarningsArray()

public getWarningsArray([string $record_label_prefix = null ]) : array<string|int, mixed>
Parameters
$record_label_prefix : string = null
Return values
array<string|int, mixed>

hasError()

public hasError( $label) : bool
Parameters
$label :
Return values
bool

hasWarning()

public hasWarning( $label) : bool
Parameters
$label :
Return values
bool

inArrayKey()

public inArrayKey( $label,  $key,  $msg,  $array) : bool
Parameters
$label :
$key :
$msg :
$array :
Return values
bool

inArrayValue()

public inArrayValue( $label,  $value,  $msg,  $array) : bool
Parameters
$label :
$value :
$msg :
$array :
Return values
bool

isAllowedValues()

public isAllowedValues( $label,  $value,  $msg,  $bad_words) : bool
Parameters
$label :
$value :
$msg :
$bad_words :
Return values
bool

isAllowedWords()

public isAllowedWords( $label,  $value,  $msg,  $bad_words) : bool
Parameters
$label :
$value :
$msg :
$bad_words :
Return values
bool

isAlphaNumeric()

public isAlphaNumeric( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isDate()

public isDate( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isDigits()

public isDigits( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isDuplicateCharacters()

public isDuplicateCharacters( $label,  $value[, null $msg = null ][, bool $max_duplicate_percent = false ][, bool $consecutive_only = false ]) : bool
Parameters
$label :
$value :
$msg : null = null
$max_duplicate_percent : bool = false
$consecutive_only : bool = false
Return values
bool

isEmail()

public isEmail( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isEmailAdvanced()

public isEmailAdvanced( $label,  $value[, null $msg = null ][, bool $error_level = true ][, mixed $enable_smtp_verification = false ]) : bool
Parameters
$label :
$value :
$msg : null = null
$error_level : bool = true
$enable_smtp_verification : mixed = false
Tags
noinspection

PhpUndefinedConstantInspection

Return values
bool

isError()

public final isError([null $label = null ]) : bool
Parameters
$label : null = null
Return values
bool

isFalse()

public isFalse( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isFloat()

public isFloat( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isGreaterThan()

public isGreaterThan( $label,  $value[, null $msg = null ][, null $min = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
$min : null = null
Return values
bool

isIPAddress()

public isIPAddress( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isLength()

public isLength( $label,  $value[, null $msg = null ][, int $min = 1 ][, int $max = 255 ]) : bool
Parameters
$label :
$value :
$msg : null = null
$min : int = 1
$max : int = 255
Return values
bool

isLengthAfterDecimal()

public isLengthAfterDecimal( $label,  $value[, null $msg = null ][, int $min = 1 ][, int $max = 255 ]) : bool
Parameters
$label :
$value :
$msg : null = null
$min : int = 1
$max : int = 255
Return values
bool

isLengthBeforeDecimal()

public isLengthBeforeDecimal( $label,  $value[, null $msg = null ][, int $min = 1 ][, int $max = 255 ]) : bool
Parameters
$label :
$value :
$msg : null = null
$min : int = 1
$max : int = 255
Return values
bool

isLessThan()

public isLessThan( $label,  $value[, null $msg = null ][, null $max = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
$max : null = null
Return values
bool

isNotNull()

public isNotNull( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isNotRegEx()

public isNotRegEx( $label,  $value,  $msg,  $regex) : bool
Parameters
$label :
$value :
$msg :
$regex :
Return values
bool

isNotResultSetWithRows()

public isNotResultSetWithRows( $label,  $rs[, null $msg = null ]) : bool
Parameters
$label :
$rs :
$msg : null = null
Return values
bool

isNull()

public isNull( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isNumeric()

public isNumeric( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isPhoneNumber()

public isPhoneNumber( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isPostalCode()

public isPostalCode( $label,  $value[, null $msg = null ][, null $country = null ][, null $province = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
$country : null = null
$province : null = null
Return values
bool

isRegEx()

public isRegEx( $label,  $value,  $msg,  $regex) : bool
Parameters
$label :
$value :
$msg :
$regex :
Return values
bool

isResultSetWithRows()

Checks a result set for one or more rows.

public isResultSetWithRows( $label,  $rs[, null $msg = null ]) : bool
Parameters
$label :
$rs :
$msg : null = null
Return values
bool

isSIN()

public isSIN( $label,  $value[, null $msg = null ][, null $country = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
$country : null = null
Return values
bool

isTrue()

Function to simple set an error.

public isTrue( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isUniqueCharacters()

public isUniqueCharacters( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isUUID()

public isUUID( $label,  $value[, null $msg = null ]) : bool
Parameters
$label :
$value :
$msg : null = null
Return values
bool

isValid()

public final isValid([null $label = null ]) : bool
Parameters
$label : null = null
Return values
bool

isWarning()

public final isWarning([null $label = null ]) : bool
Parameters
$label : null = null
Return values
bool

merge()

Merges all errors/warnings from the passed $validator object to this one.

public merge(object $validator) : bool
Parameters
$validator : object
Return values
bool

purifyHTML()

public purifyHTML( $value) : string
Parameters
$value :
Return values
string

resetWarnings()

public resetWarnings() : bool
Return values
bool

setValidateOnly()

public setValidateOnly(int $validate_only) : mixed
Parameters
$validate_only : int

EPOCH

Return values
mixed

stripHTML()

public stripHTML( $value) : string
Parameters
$value :
Return values
string

stripNon32bitInteger()

public stripNon32bitInteger( $value) : int
Parameters
$value :
Return values
int

stripNonAlphaNumeric()

public stripNonAlphaNumeric( $value) : mixed
Parameters
$value :
Return values
mixed

stripNonFloat()

public stripNonFloat( $value) : int|float|string
Parameters
$value :

int|float|string

Return values
int|float|string

stripNonNumeric()

public stripNonNumeric( $value) : mixed
Parameters
$value :
Return values
mixed

stripNonTimeUnit()

Suitable for passing to parseTimeUnit() after.

public stripNonTimeUnit( $value) : mixed
Parameters
$value :
Return values
mixed

stripNumeric()

public stripNumeric( $value) : mixed
Parameters
$value :
Return values
mixed

stripSpaces()

public stripSpaces( $value) : mixed
Parameters
$value :
Return values
mixed

varReplace()

public varReplace( $string,  $var_array) : mixed
Parameters
$string :
$var_array :
Return values
mixed

Warning()

public Warning( $label,  $msg[, string $value = '' ]) : bool
Parameters
$label :
$msg :
$value : string = ''
Return values
bool

addRecordLabelPrefixToArray()

private addRecordLabelPrefixToArray(mixed $arr[, string $record_label_prefix = null ]) : array<string|int, mixed>
Parameters
$arr : mixed
$record_label_prefix : string = null
Return values
array<string|int, mixed>

Search results