ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\Refinery\Logical\LogicalOr Class Reference
+ Inheritance diagram for ILIAS\Refinery\Logical\LogicalOr:
+ Collaboration diagram for ILIAS\Refinery\Logical\LogicalOr:

Public Member Functions

 __construct (array $other, Data\Factory $data_factory, \ilLanguage $lng)
 LogicalOr constructor. More...
 
- 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...
 
 applyTo (Result $data)
 Perform the transformation and reify possible failures. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Protected Attributes

 $other = []
 

Detailed Description

Definition at line 14 of file LogicalOr.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\Logical\LogicalOr::__construct ( array  $other,
Data\Factory  $data_factory,
\ilLanguage  $lng 
)

LogicalOr constructor.

Parameters
Constraint[]$other
Data\Factory$data_factory

Definition at line 26 of file LogicalOr.php.

27 {
28 $this->other = $other;
29
31 function ($value) {
32 foreach ($this->other as $constraint) {
33 if ($constraint->accepts($value)) {
34 return true;
35 }
36 }
37
38 return false;
39 },
40 function ($value) {
41 $problems = [];
42
43 foreach ($this->other as $constraint) {
44 $problems[] = (string) $constraint->getErrorMessage($value);
45 }
46
47 return 'Please fix one of these: ' . implode(', ', array_filter($problems));
48 },
49 $data_factory,
50 $lng
51 );
52 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$lng

References $lng, ILIAS\Refinery\Logical\LogicalOr\$other, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Field Documentation

◆ $other

ILIAS\Refinery\Logical\LogicalOr::$other = []
protected

Definition at line 19 of file LogicalOr.php.

Referenced by ILIAS\Refinery\Logical\LogicalOr\__construct().


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