ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Refinery\In\Parallel Class Reference
+ Inheritance diagram for ILIAS\Refinery\In\Parallel:
+ Collaboration diagram for ILIAS\Refinery\In\Parallel:

Public Member Functions

 __construct (array $transformations)
 
 transform ($from)
 Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
Exceptions
More...
 
- Public Member Functions inherited from ILIAS\Refinery\Transformation
 applyTo (Result $data)
 Perform the transformation and reify possible failures. More...
 
 __invoke ($from)
 Transformations should be callable. More...
 

Private Attributes

 $transformationStrategies
 

Detailed Description

Definition at line 16 of file Parallel.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Refinery\In\Parallel::__construct ( array  $transformations)
Parameters
array$transformations
Exceptions

Definition at line 30 of file Parallel.php.

31  {
32  foreach ($transformations as $transformation) {
33  if (!$transformation instanceof Transformation) {
34  $transformationClassName = Transformation::class;
35 
36  throw new ConstraintViolationException(
37  sprintf('The array MUST contain only "%s" instances', $transformationClassName),
38  'not_a_transformation',
39  $transformationClassName
40  );
41  }
42  }
43  $this->transformationStrategies = $transformations;
44  }

Member Function Documentation

◆ transform()

ILIAS\Refinery\In\Parallel::transform (   $from)

Perform the transformation.Please use this for transformations. It's more performant than calling invoke.

Exceptions

Implements ILIAS\Refinery\Transformation.

Definition at line 49 of file Parallel.php.

References $results.

50  {
51  $results = array();
52  foreach ($this->transformationStrategies as $strategy) {
53  $results[] = $strategy->transform($from);
54  }
55 
56  return $results;
57  }
$results

Field Documentation

◆ $transformationStrategies

ILIAS\Refinery\In\Parallel::$transformationStrategies
private

Definition at line 24 of file Parallel.php.


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