ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Factory for creating constraints. More...
Public Member Functions | |
__construct (Data\Factory $data_factory, \ilLanguage $lng) | |
Factory constructor. More... | |
sequential (array $others) | |
Get a constraint that sequentially checks the supplied constraints. More... | |
parallel (array $others) | |
Get a constraint that checks the supplied constraints in parallel. More... | |
not (Constraint $other) | |
Get a negated constraint. More... | |
or (array $others) | |
Get a logical or constraint. More... | |
isInt () | |
Get a constraint for an integer. More... | |
isString () | |
Get a constraint for a string. More... | |
isArrayOf (Constraint $on_element) | |
Get a constraint for a array with constraint to all elements. More... | |
greaterThan ($min) | |
Get the constraint that some value is larger than $min. More... | |
lessThan ($max) | |
Get the constraint that some value is smaller then $max. More... | |
isNumeric () | |
Get the constraint that some value is a number. More... | |
isNull () | |
Get the constraint that some value is null. More... | |
hasMinLength ($min_length) | |
Get the constraint that some string has a minimum length. More... | |
hasMaxLength ($max_length) | |
Get the constraint that limits the maximum length of the string. More... | |
custom (callable $is_ok, $error) | |
Get a custom constraint. More... | |
password () | |
Get the factory for password constraints. More... | |
Data Fields | |
const | LANGUAGE_MODULE = "validation" |
Protected Attributes | |
$data_factory | |
$lng | |
Factory for creating constraints.
Definition at line 12 of file Factory.php.
ILIAS\Validation\Factory::__construct | ( | Data\Factory | $data_factory, |
\ilLanguage | $lng | ||
) |
Factory constructor.
Data\Factory | $data_factory |
Definition at line 31 of file Factory.php.
References $lng.
ILIAS\Validation\Factory::custom | ( | callable | $is_ok, |
$error | |||
) |
Get a custom constraint.
If the provided value !$is_ok will either use the $error (if it is a string) or provide the value to the $error callback.
If $error is a callable it needs to take two parameters:
callable | $is_ok | MUST return boolean |
string | callable | $error |
Definition at line 204 of file Factory.php.
ILIAS\Validation\Factory::greaterThan | ( | $min | ) |
Get the constraint that some value is larger than $min.
int | $min |
Definition at line 130 of file Factory.php.
ILIAS\Validation\Factory::hasMaxLength | ( | $max_length | ) |
Get the constraint that limits the maximum length of the string.
int | $max_length |
Definition at line 183 of file Factory.php.
ILIAS\Validation\Factory::hasMinLength | ( | $min_length | ) |
Get the constraint that some string has a minimum length.
int | $min_length |
Definition at line 172 of file Factory.php.
ILIAS\Validation\Factory::isArrayOf | ( | Constraint | $on_element | ) |
Get a constraint for a array with constraint to all elements.
Constraint | $on_element |
Definition at line 119 of file Factory.php.
ILIAS\Validation\Factory::isInt | ( | ) |
ILIAS\Validation\Factory::isNull | ( | ) |
Get the constraint that some value is null.
Definition at line 161 of file Factory.php.
ILIAS\Validation\Factory::isNumeric | ( | ) |
Get the constraint that some value is a number.
Definition at line 151 of file Factory.php.
ILIAS\Validation\Factory::isString | ( | ) |
ILIAS\Validation\Factory::lessThan | ( | $max | ) |
Get the constraint that some value is smaller then $max.
int | $max |
Definition at line 141 of file Factory.php.
ILIAS\Validation\Factory::not | ( | Constraint | $other | ) |
Get a negated constraint.
Constraint | $other |
Definition at line 73 of file Factory.php.
ILIAS\Validation\Factory::or | ( | array | $others | ) |
Get a logical or constraint.
Constraint[] | $others |
Definition at line 83 of file Factory.php.
ILIAS\Validation\Factory::parallel | ( | array | $others | ) |
Get a constraint that checks the supplied constraints in parallel.
The new constraint tells the problems of all violated constraints.
Constraint[] | $others |
Definition at line 62 of file Factory.php.
ILIAS\Validation\Factory::password | ( | ) |
ILIAS\Validation\Factory::sequential | ( | array | $others | ) |
Get a constraint that sequentially checks the supplied constraints.
The new constraint tells the problem of the first violated constraint.
Constraint[] | $others |
Definition at line 49 of file Factory.php.
|
protected |
Definition at line 19 of file Factory.php.
|
protected |
Definition at line 24 of file Factory.php.
const ILIAS\Validation\Factory::LANGUAGE_MODULE = "validation" |
Definition at line 14 of file Factory.php.