ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
Not.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 2017 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Validation\Constraints
;
5
6
use
ILIAS\Validation\Constraint
;
7
use
ILIAS\Data
;
8
use
ILIAS\Data\Result
;
9
10
class
Not
extends
Custom
implements
Constraint
11
{
12
const
ERROR_MESSAGE_PREFIX
=
"It is not the case that:"
;
13
17
protected
$constraint
;
18
19
public
function
__construct
(
Constraint
$constraint
, Data\
Factory
$data_factory
)
20
{
21
$this->constraint =
$constraint
;
22
parent::__construct(
23
function
($value) {
24
return
!$this->constraint->accepts($value);
25
},
26
function
($value) {
27
return
self::ERROR_MESSAGE_PREFIX .
": "
. $this->constraint->getErrorMessage($value);
28
},
29
$data_factory
30
);
31
}
32
}
ILIAS\Data\Result
Definition:
Error.php:4
ILIAS\Validation\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:14
Constraint
ILIAS\Validation\Constraints\Not\ERROR_MESSAGE_PREFIX
const ERROR_MESSAGE_PREFIX
Definition:
Not.php:12
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
ILIAS\Validation\Constraints\Not\$constraint
$constraint
Definition:
Not.php:17
ILIAS\Validation\Constraints\Custom
Definition:
Custom.php:10
ILIAS\Validation\Constraints
Definition:
Custom.php:4
ILIAS\Validation\Constraints\Not\__construct
__construct(Constraint $constraint, Data\Factory $data_factory)
Definition:
Not.php:19
ILIAS\Validation\Constraints\Not
Definition:
Not.php:10
ILIAS\Validation\Constraints\Custom\$data_factory
$data_factory
Definition:
Custom.php:15
ILIAS\Data
Definition:
ClientId.php:4
src
Validation
Constraints
Not.php
Generated on Tue Jan 28 2025 19:01:14 for ILIAS by
1.8.13 (using
Doxyfile
)