|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Inheritance diagram for ILIAS\Validation\Constraints\Custom:
Collaboration diagram for ILIAS\Validation\Constraints\Custom:Public Member Functions | ||||||
| __construct (callable $is_ok, $error, Data\Factory $data_factory, \ilLanguage $lng) | ||||||
| If $error is a callable it needs to take two parameters: More... | ||||||
| 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.The builder needs to be callable that takes two parameters:
| ||||||
| 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 Member Functions | |
| getLngClosure () | |
| Get the closure to be passed to the error-function that does i18n and sprintf. More... | |
Protected Attributes | |
| $data_factory | |
| $lng | |
| $is_ok | |
| $error | |
Definition at line 10 of file Custom.php.
| ILIAS\Validation\Constraints\Custom::__construct | ( | callable | $is_ok, |
| $error, | |||
| Data\Factory | $data_factory, | ||
| \ilLanguage | $lng | ||
| ) |
If $error is a callable it needs to take two parameters:
| string | callable | $error |
Definition at line 41 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\$data_factory, ILIAS\Validation\Constraints\Custom\$error, ILIAS\Validation\Constraints\Custom\$is_ok, ILIAS\Validation\Constraints\Custom\$lng, and error().
Here is the call graph for this function:
|
final |
Tells if the provided value complies.
| mixed | $value |
Implements ILIAS\Validation\Constraint.
Definition at line 72 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Custom\check(), ILIAS\Validation\Constraints\Custom\problemWith(), and LogicalOrTest\testAccept().
Here is the caller graph for this function:
|
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 60 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\accepts(), and ILIAS\Validation\Constraints\Custom\getErrorMessage().
Referenced by LogicalOrTest\testCheck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
final |
Get the problem message.
Definition at line 122 of file Custom.php.
References error(), and ILIAS\Validation\Constraints\Custom\getLngClosure().
Referenced by ILIAS\Validation\Constraints\Custom\check(), and ILIAS\Validation\Constraints\Custom\problemWith().
Here is the call graph for this function:
Here is the caller graph for this function:
|
finalprotected |
Get the closure to be passed to the error-function that does i18n and sprintf.
Definition at line 134 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\$error, and $i.
Referenced by ILIAS\Validation\Constraints\Custom\getErrorMessage().
Here is the caller graph for this function:
|
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 80 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\accepts(), and ILIAS\Validation\Constraints\Custom\getErrorMessage().
Referenced by ILIAS\Validation\Constraints\Custom\restrict(), and LogicalOrTest\testProblemWith().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 | $result |
Implements ILIAS\Validation\Constraint.
Definition at line 92 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\$error, $result, ILIAS\Validation\Constraints\Custom\problemWith(), and ILIAS\Data\Result\value().
Referenced by LogicalOrTest\testRestrict().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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.The builder needs to be callable that takes two parameters:
| callable | $builder |
Implements ILIAS\Validation\Constraint.
Definition at line 110 of file Custom.php.
References $builder.
Referenced by LogicalOrTest\testWithProblemBuilder().
Here is the caller graph for this function:
|
protected |
Definition at line 15 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Parallel\__construct(), ILIAS\Validation\Constraints\Sequential\__construct(), ILIAS\Validation\Constraints\LogicalOr\__construct(), ILIAS\Validation\Constraints\Custom\__construct(), ILIAS\Validation\Constraints\Not\__construct(), ILIAS\Validation\Constraints\IsInt\__construct(), ILIAS\Validation\Constraints\IsNull\__construct(), ILIAS\Validation\Constraints\IsNumeric\__construct(), ILIAS\Validation\Constraints\IsString\__construct(), ILIAS\Validation\Constraints\Password\HasLowerChars\__construct(), ILIAS\Validation\Constraints\Password\HasNumbers\__construct(), ILIAS\Validation\Constraints\Password\HasSpecialChars\__construct(), ILIAS\Validation\Constraints\Password\HasUpperChars\__construct(), ILIAS\Validation\Constraints\IsArrayOf\__construct(), ILIAS\Validation\Constraints\LessThan\__construct(), ILIAS\Validation\Constraints\HasMaxLength\__construct(), ILIAS\Validation\Constraints\GreaterThan\__construct(), ILIAS\Validation\Constraints\HasMinLength\__construct(), and ILIAS\Validation\Constraints\Password\HasMinLength\__construct().
|
protected |
Definition at line 30 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Custom\__construct(), ILIAS\Validation\Constraints\Custom\getLngClosure(), and ILIAS\Validation\Constraints\Custom\restrict().
|
protected |
Definition at line 25 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\Custom\__construct().
|
protected |
Definition at line 20 of file Custom.php.
Referenced by ilTermsOfServiceDocumentCriterionAssignmentConstraint\__construct(), ILIAS\Validation\Constraints\Parallel\__construct(), ILIAS\Validation\Constraints\Sequential\__construct(), ILIAS\Validation\Constraints\LogicalOr\__construct(), ILIAS\Validation\Constraints\Custom\__construct(), ILIAS\Validation\Constraints\Not\__construct(), ILIAS\Validation\Constraints\IsInt\__construct(), ILIAS\Validation\Constraints\IsNull\__construct(), ILIAS\Validation\Constraints\IsNumeric\__construct(), ILIAS\Validation\Constraints\IsString\__construct(), ILIAS\Validation\Constraints\Password\HasLowerChars\__construct(), ILIAS\Validation\Constraints\Password\HasNumbers\__construct(), ILIAS\Validation\Constraints\Password\HasSpecialChars\__construct(), ILIAS\Validation\Constraints\Password\HasUpperChars\__construct(), ILIAS\Validation\Constraints\IsArrayOf\__construct(), ILIAS\Validation\Constraints\LessThan\__construct(), ILIAS\Validation\Constraints\HasMaxLength\__construct(), ILIAS\Validation\Constraints\GreaterThan\__construct(), ILIAS\Validation\Constraints\HasMinLength\__construct(), and ILIAS\Validation\Constraints\Password\HasMinLength\__construct().