\hhu\z\controllers\componentsValidationComponent

Component to validate user input.

Summary

Methods
Properties
Constants
load()
factory()
__construct()
validate()
validateParam()
validateParams()
addValidationResult()
addValidationResults()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
getClassName()
$config
N/A

Properties

$config

$config : array

Validation settings

Type

array

Methods

load()

load(string  $componentName) 

Load the class of a Component.

Parameters

string $componentName

Name of the Component to load

Throws

\nre\exceptions\ComponentNotFoundException
\nre\exceptions\ComponentNotValidException

factory()

factory(string  $componentName) 

Instantiate a Component (Factory Pattern).

Parameters

string $componentName

Name of the Component to instantiate

__construct()

__construct() 

Construct a new Validation-component.

validate()

validate(mixed  $input, array  $settings) : mixed

Validate an user input.

Parameters

mixed $input

User input to validate

array $settings

Validation setting

Returns

mixed —

True or the settings the validation fails on

validateParam()

validateParam(array  $params, array  $index) : mixed

Validate an user input parameter.

Parameters

array $params

User input parameters

array $index

Names of parameter to validate and to validate against

Returns

mixed —

True or the parameter with settings the validation failed on

validateParams()

validateParams(array  $params, array  $indices) : mixed

Validate user input parameters.

Parameters

array $params

User input parameters

array $indices

Names of parameters to validate and to validate against

Returns

mixed —

True or the parameters with settings the validation failed on

addValidationResult()

addValidationResult(mixed  $validation, string  $index, string  $setting, mixed  $result) : mixed

Add a custom determined validation result to a validation array.

Parameters

mixed $validation

Validation array to add result to

string $index

Name of parameter of the custom validation result

string $setting

Name of setting of the custom validation result

mixed $result

Validation result

Returns

mixed —

The altered validation array

addValidationResults()

addValidationResults(mixed  $validation, string  $index,   $results) : mixed

Add custom determined validation results to a validation arary.

Parameters

mixed $validation

Validation array to add result to

string $index

Name of parameter of the custom validation result

$results

Returns

mixed —

The altered validation array

getClassName()

getClassName(string  $componentName) : string

Determine the classname for the given Component name.

Parameters

string $componentName

Component name to get classname of

Returns

string —

Classname for the Component name