ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Public Member Functions | ||||||
__construct (callable $is_ok, $error, Data\Factory $data_factory) | ||||||
check ($value) | ||||||
Checks the provided value.Should not throw if accepts($value).
UnexpectedValueException if value does not comply with encoded constraint.
| ||||||
accepts ($value) | ||||||
Tells if the provided value complies.
| ||||||
problemWith ($value) | ||||||
Tells what the problem with the provided value is.Should return null if accepts($value).
| ||||||
restrict (Result $result) | ||||||
Restricts a Result.Must do nothing with the result if $result->isError(). Must replace the result with an error according to problemWith() if !accepts($result->value()).
| ||||||
withProblemBuilder (callable $builder) | ||||||
Get a constraint like this one with a builder for a custom error message.problemWith() must return an error message according to the new builder for the new constraint.
| ||||||
getErrorMessage ($value) | ||||||
Get the problem message. More... | ||||||
check ($value) | ||||||
Checks the provided value. More... | ||||||
accepts ($value) | ||||||
Tells if the provided value complies. More... | ||||||
problemWith ($value) | ||||||
Tells what the problem with the provided value is. More... | ||||||
restrict (Result $result) | ||||||
Restricts a Result. More... | ||||||
withProblemBuilder (callable $builder) | ||||||
Get a constraint like this one with a builder for a custom error message. More... | ||||||
Protected Attributes | |
$data_factory | |
$is_ok | |
$error | |
Definition at line 10 of file Custom.php.
ILIAS\Validation\Constraints\Custom::__construct | ( | callable | $is_ok, |
$error, | |||
Data\Factory | $data_factory | ||
) |
string | callable | $error |
Definition at line 30 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\$data_factory, ILIAS\Validation\Constraints\Custom\$error, ILIAS\Validation\Constraints\Custom\$is_ok, and error().
|
final |
Tells if the provided value complies.
mixed | $value |
Implements ILIAS\Validation\Constraint.
Definition at line 60 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Custom\check(), and ILIAS\Validation\Constraints\Custom\problemWith().
|
final |
Checks the provided value.Should not throw if accepts($value).
UnexpectedValueException if value does not comply with encoded constraint.
mixed | $value |
Implements ILIAS\Validation\Constraint.
Definition at line 48 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\accepts(), and ILIAS\Validation\Constraints\Custom\getErrorMessage().
|
final |
Get the problem message.
Definition at line 110 of file Custom.php.
References error().
Referenced by ILIAS\Validation\Constraints\Custom\check(), and ILIAS\Validation\Constraints\Custom\problemWith().
|
final |
Tells what the problem with the provided value is.Should return null if accepts($value).
mixed | $value |
Implements ILIAS\Validation\Constraint.
Definition at line 68 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\accepts(), and ILIAS\Validation\Constraints\Custom\getErrorMessage().
Referenced by ILIAS\Validation\Constraints\Custom\restrict().
|
final |
Restricts a Result.Must do nothing with the result if $result->isError(). Must replace the result with an error according to problemWith() if !accepts($result->value()).
Result | $value |
Implements ILIAS\Validation\Constraint.
Definition at line 80 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\$error, $result, ILIAS\Validation\Constraints\Custom\problemWith(), and ILIAS\Data\Result\value().
|
final |
Get a constraint like this one with a builder for a custom error message.problemWith() must return an error message according to the new builder for the new constraint.
callable | $builder | mixed -> string |
Implements ILIAS\Validation\Constraint.
Definition at line 98 of file Custom.php.
References $builder.
|
protected |
Definition at line 15 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\LessThan\__construct(), ILIAS\Validation\Constraints\GreaterThan\__construct(), ILIAS\Validation\Constraints\Parallel\__construct(), ILIAS\Validation\Constraints\Sequential\__construct(), ILIAS\Validation\Constraints\Custom\__construct(), ILIAS\Validation\Constraints\Not\__construct(), and ILIAS\Validation\Constraints\IsInt\__construct().
|
protected |
Definition at line 25 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Custom\__construct(), and ILIAS\Validation\Constraints\Custom\restrict().
|
protected |
Definition at line 20 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Custom\__construct().