ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
Sequential.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
Sequential
extends
Custom
implements
Constraint
11
{
15
protected
$constraints
;
16
23
protected
$failed_constraint
;
24
25
public
function
__construct
(
array
$constraints
, Data\
Factory
$data_factory
)
26
{
27
$this->constraints =
$constraints
;
28
parent::__construct(
29
function
($value) {
30
foreach
($this->constraints as
$key
=> $constraint) {
31
if
(!$constraint->accepts($value)) {
32
$this->failed_constraint = $constraint;
33
return
false
;
34
}
35
}
36
37
return
true
;
38
},
39
function
($value) {
40
return
$this->failed_constraint->getErrorMessage($value);
41
},
42
$data_factory
43
);
44
}
45
}
ILIAS\Validation\Constraints\Sequential
Definition:
Sequential.php:10
ILIAS\Data\Result
Definition:
Error.php:4
ILIAS\Validation\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:14
ILIAS\Validation\Constraints\Sequential\$constraints
$constraints
Definition:
Sequential.php:15
Constraint
ILIAS\Validation\Constraints\Sequential\__construct
__construct(array $constraints, Data\Factory $data_factory)
Definition:
Sequential.php:25
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
ILIAS\Validation\Constraints\Sequential\$failed_constraint
$failed_constraint
Definition:
Sequential.php:23
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ILIAS\Validation\Constraints\Custom
Definition:
Custom.php:10
ILIAS\Validation\Constraints
Definition:
Custom.php:4
ILIAS\Validation\Constraints\Custom\$data_factory
$data_factory
Definition:
Custom.php:15
$key
$key
Definition:
croninfo.php:18
ILIAS\Data
Definition:
ClientId.php:4
src
Validation
Constraints
Sequential.php
Generated on Tue Jan 28 2025 19:01:46 for ILIAS by
1.8.13 (using
Doxyfile
)