ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Sequential.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Refinery\Custom\Constraint as CustomConstraint;
25use ILIAS\Data;
26
27class Sequential extends CustomConstraint
28{
36
42 public function __construct(array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
43 {
45 function ($value) use ($constraints): bool {
46 foreach ($constraints as $constraint) {
47 if (!$constraint->accepts($value)) {
48 $this->failed_constraint = $constraint;
49 return false;
50 }
51 }
52
53 return true;
54 },
55 function ($txt, $value): string {
56 return $this->failed_constraint->getErrorMessage($value);
57 },
58 $data_factory,
59 $lng
60 );
61 }
62}
Builds data types.
Definition: Factory.php:36
__construct(array $constraints, Data\Factory $data_factory, \ILIAS\Language\Language $lng)
Definition: Sequential.php:42
$txt
Definition: error.php:31
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:31