PHP Validation

ValidationInterface

Describes Validation interface.

Table of Contents

Methods

getErrorCode()  : int
Retrieve last error code.
getErrorMessage()  : string
Retrieve last error message.
isValid()  : bool
Check if data is valid.
validate()  : static
Validate the data using defined rules.

Methods

getErrorCode()

Retrieve last error code.

public getErrorCode() : int
Return values
int

getErrorMessage()

Retrieve last error message.

public getErrorMessage() : string
Return values
string

isValid()

Check if data is valid.

public isValid(array<string, mixed> $Data) : bool
Parameters
$Data : array<string, mixed>

The data to be validated.

Tags
throws
InvalidArgumentException

If error.

Return values
bool

validate()

Validate the data using defined rules.

public validate(array<string, mixed> $Data) : static
Parameters
$Data : array<string, mixed>

The data to be validated.

Tags
throws
InvalidArgumentException

If error.

throws
ValidationException

If invalid.

Return values
static

        
On this page

Search results