HumHub Documentation (unofficial)

BaseConstraint
in package

A more basic constraint definition - used for the public interface to avoid exposing library internals.

Table of Contents

Properties

$errorMask  : int
$errors  : array<string|int, mixed>
$factory  : Factory

Methods

__construct()  : mixed
addError()  : mixed
addErrors()  : mixed
arrayToObjectRecursive()  : object
Recursively cast an associative array to an object
getErrorMask()  : int
Get the error mask
getErrors()  : mixed
isValid()  : mixed
numErrors()  : mixed
reset()  : mixed
Clears any reported errors. Should be used between multiple validation checks.

Properties

$errorMask

protected int $errorMask = \JsonSchema\Validator::ERROR_NONE

All error types which have occurred

$errors

protected array<string|int, mixed> $errors = array()

Errors

Methods

addError()

public addError([JsonPointer $path = null ], mixed $message[, mixed $constraint = '' ][, array<string|int, mixed> $more = null ]) : mixed
Parameters
$path : JsonPointer = null
$message : mixed
$constraint : mixed = ''
$more : array<string|int, mixed> = null

addErrors()

public addErrors(array<string|int, mixed> $errors) : mixed
Parameters
$errors : array<string|int, mixed>

arrayToObjectRecursive()

Recursively cast an associative array to an object

public static arrayToObjectRecursive(array<string|int, mixed> $array) : object
Parameters
$array : array<string|int, mixed>
Return values
object

getErrorMask()

Get the error mask

public getErrorMask() : int
Return values
int

getErrors()

public getErrors([mixed $errorContext = Validator::ERROR_ALL ]) : mixed
Parameters
$errorContext : mixed = Validator::ERROR_ALL

numErrors()

public numErrors([mixed $errorContext = Validator::ERROR_ALL ]) : mixed
Parameters
$errorContext : mixed = Validator::ERROR_ALL

reset()

Clears any reported errors. Should be used between multiple validation checks.

public reset() : mixed

        
On this page

Search results