ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
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).
| ||||
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... | ||||
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, and ILIAS\Validation\Constraints\Custom\$lng.
|
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().
|
final |
Checks the provided value.Should not throw if accepts($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().
|
final |
Get the problem message.
Definition at line 122 of file Custom.php.
References ILIAS\Validation\Constraints\Custom\getLngClosure().
Referenced by ILIAS\Validation\Constraints\Custom\check(), and ILIAS\Validation\Constraints\Custom\problemWith().
|
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().
|
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().
|
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\Data\Result\isError(), ILIAS\Validation\Constraints\Custom\problemWith(), and ILIAS\Data\Result\value().
Referenced by LogicalOrTest\testRestrict().
|
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().
|
protected |
Definition at line 15 of file Custom.php.
Referenced by ILIAS\Validation\Constraints\IsInt\__construct(), ILIAS\Validation\Constraints\Password\HasNumbers\__construct(), ILIAS\Validation\Constraints\Password\HasUpperChars\__construct(), ILIAS\Validation\Constraints\Password\HasLowerChars\__construct(), ILIAS\Validation\Constraints\IsNumeric\__construct(), ILIAS\Validation\Constraints\Password\HasSpecialChars\__construct(), ILIAS\Validation\Constraints\HasMaxLength\__construct(), ILIAS\Validation\Constraints\Not\__construct(), ILIAS\Validation\Constraints\HasMinLength\__construct(), ILIAS\Validation\Constraints\Password\HasMinLength\__construct(), ILIAS\Validation\Constraints\LessThan\__construct(), ILIAS\Validation\Constraints\GreaterThan\__construct(), ILIAS\Validation\Constraints\IsString\__construct(), ILIAS\Validation\Constraints\IsArrayOf\__construct(), ILIAS\Validation\Constraints\Parallel\__construct(), ILIAS\Validation\Constraints\IsNull\__construct(), ILIAS\Validation\Constraints\Sequential\__construct(), ILIAS\Validation\Constraints\LogicalOr\__construct(), and ILIAS\Validation\Constraints\Custom\__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 ILIAS\Validation\Constraints\IsInt\__construct(), ILIAS\Validation\Constraints\Password\HasLowerChars\__construct(), ILIAS\Validation\Constraints\Password\HasNumbers\__construct(), ILIAS\Validation\Constraints\Password\HasUpperChars\__construct(), ILIAS\Validation\Constraints\IsNumeric\__construct(), ILIAS\Validation\Constraints\Password\HasSpecialChars\__construct(), ILIAS\Validation\Constraints\HasMaxLength\__construct(), ILIAS\Validation\Constraints\Not\__construct(), ILIAS\Validation\Constraints\GreaterThan\__construct(), ILIAS\Validation\Constraints\HasMinLength\__construct(), ILIAS\Validation\Constraints\LessThan\__construct(), ILIAS\Validation\Constraints\Password\HasMinLength\__construct(), ILIAS\Validation\Constraints\IsString\__construct(), ILIAS\Validation\Constraints\Sequential\__construct(), ILIAS\Validation\Constraints\IsArrayOf\__construct(), ILIAS\Validation\Constraints\Parallel\__construct(), ILIAS\Validation\Constraints\IsNull\__construct(), ILIAS\Validation\Constraints\LogicalOr\__construct(), ilTermsOfServiceDocumentCriterionAssignmentConstraint\__construct(), and ILIAS\Validation\Constraints\Custom\__construct().