# \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

File
  controllers/components/ValidationComponent.inc
Package
  Default
Class hierarchy
  \nre\core\Component
  \hhu\z\controllers\components\ValidationComponent

## Tags

author | Oliver Hanraths oliver.hanraths@uni-duesseldorf.de

## Properties

### $config

    $config : array

Validation settings

#### Type

array

#

## Tags

None found

## 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

#

static

Inherited from
  \nre\core\Component

## Tags

None found

### factory()

    factory(string  $componentName)

Instantiate a Component (Factory Pattern).

#### Parameters

string | $componentName | Name of the Component to instantiate

#

static

Inherited from
  \nre\core\Component

## Tags

None found

### __construct()

    __construct()

Construct a new Validation-component.

#

## Tags

None found

### 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

#

## Tags

None found

### 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

#

## Tags

None found

### 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

#

## Tags

None found

### 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

#

## Tags

None found

### 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

#

## Tags

None found

### 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

#

static

Inherited from
  \nre\core\Component

## Tags

None found

### ValidationComponent.inc