ILIAS  release_8 Revision v8.24
LogicalOr.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
24use ILIAS\Data;
25use ilLanguage;
26
27class LogicalOr extends Constraint
28{
35 public function __construct(array $other, Data\Factory $data_factory, ilLanguage $lng)
36 {
38 static function ($value) use ($other): bool {
39 foreach ($other as $constraint) {
40 if ($constraint->accepts($value)) {
41 return true;
42 }
43 }
44
45 return false;
46 },
47 static function ($value) use ($other): string {
48 $problems = [];
49
50 foreach ($other as $constraint) {
51 $problems[] = $constraint->getErrorMessage($value);
52 }
53
54 return 'Please fix one of these: ' . implode(', ', array_filter($problems));
55 },
56 $data_factory,
57 $lng
58 );
59 }
60}
Builds data types.
Definition: Factory.php:21
__construct(array $other, Data\Factory $data_factory, ilLanguage $lng)
LogicalOr constructor.
Definition: LogicalOr.php:35
language handling
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Group.php:21
$lng