ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Refinery\Logical\Parallel Class Reference
+ Inheritance diagram for ILIAS\Refinery\Logical\Parallel:
+ Collaboration diagram for ILIAS\Refinery\Logical\Parallel:

Public Member Functions

 __construct (array $constraints, Data\Factory $data_factory, ilLanguage $lng)
 
- Public Member Functions inherited from ILIAS\Refinery\Constraint
 check ($value)
 Checks the provided value. More...
 
 accepts ($value)
 Tells if the provided value complies. More...
 
 problemWith ($value)
 Tells what the problem with the provided value is. More...
 
 applyTo (Result $result)
 Restricts a Result. More...
 
 withProblemBuilder (callable $builder)
 Get a constraint like this one with a builder for a custom error message. More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 transform ($from)
 Perform the transformation. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Protected Attributes

array $failed_constraints
 

Detailed Description

Definition at line 27 of file Parallel.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\Logical\Parallel::__construct ( array  $constraints,
Data\Factory  $data_factory,
ilLanguage  $lng 
)
Parameters
Constraint[]$constraints
Data\Factory$data_factory
ilLanguage$lng

Definition at line 42 of file Parallel.php.

References $lng, $messages, $txt, and ILIAS\GlobalScreen\Provider\__construct().

43  {
45  function ($value) use ($constraints): bool {
46  $ret = true;
47  $this->failed_constraints = [];
48  foreach ($constraints as $constraint) {
49  if (!$constraint->accepts($value)) {
50  $this->failed_constraints[] = $constraint;
51  $ret = false;
52  }
53  }
54 
55  return $ret;
56  },
57  function ($txt, $value): string {
58  $messages = [];
59  foreach ($this->failed_constraints as $constraint) {
60  $messages[] = $constraint->getErrorMessage($value);
61  }
62 
63  return implode(" ", $messages);
64  },
65  $data_factory,
66  $lng
67  );
68  }
$lng
$messages
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: xapiexit.php:22
$txt
Definition: error.php:13
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Field Documentation

◆ $failed_constraints

array ILIAS\Refinery\Logical\Parallel::$failed_constraints
protected

Definition at line 35 of file Parallel.php.


The documentation for this class was generated from the following file: