ILIAS
release_7 Revision v7.30-3-g800a261c036
|
Adds to any array keys for each value. More...
Public Member Functions | ||||
__construct (array $labels, Factory $factory) | ||||
transform ($from) | ||||
Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
| ||||
applyTo (Result $data) | ||||
Perform the transformation and reify possible failures.If $data->isError() , the method MUST do nothing. It MUST transform the value in $data like it would transform $data provided to transform . It must reify every exception thrown in this process by returning a Result that isError() and contains the exception that happened.If you simply need to implement a transformation you most probably want to implement transform and derive this via the trait DeriveTransformationInterface .If you simply want to call the transformation, you most probably want to use transform , since it simply throws exceptions that occurred while doing the transformation.If you are implementing some entity that performs processing of input data at some boundary, the reification of exceptions might help you to write cleaner code.
| ||||
![]() | ||||
__invoke ($from) | ||||
Transformations should be callable. More... | ||||
Protected Attributes | |
$labels | |
Private Attributes | |
$factory | |
Adds to any array keys for each value.
Definition at line 14 of file AddLabels.php.
ILIAS\Refinery\Container\AddLabels::__construct | ( | array | $labels, |
Factory | $factory | ||
) |
string[] | | int[] $labels | |
Factory | null | $factory |
Definition at line 32 of file AddLabels.php.
References ILIAS\Refinery\Container\AddLabels\$factory, and ILIAS\Refinery\Container\AddLabels\$labels.
ILIAS\Refinery\Container\AddLabels::applyTo | ( | Result | $data | ) |
Perform the transformation and reify possible failures.If $data->isError()
, the method MUST do nothing. It MUST transform the value in $data
like it would transform $data provided to transform
. It must reify every exception thrown in this process by returning a Result
that isError()
and contains the exception that happened.If you simply need to implement a transformation you most probably want to implement transform and derive this via the trait DeriveTransformationInterface
.If you simply want to call the transformation, you most probably want to use transform
, since it simply throws exceptions that occurred while doing the transformation.If you are implementing some entity that performs processing of input data at some boundary, the reification of exceptions might help you to write cleaner code.
Result | $data |
Implements ILIAS\Refinery\Transformation.
Definition at line 57 of file AddLabels.php.
References $result, and ILIAS\Data\Result\value().
ILIAS\Refinery\Container\AddLabels::transform | ( | $from | ) |
Perform the transformation.Please use this for transformations. It's more performant than calling invoke.
Implements ILIAS\Refinery\Transformation.
Definition at line 41 of file AddLabels.php.
|
private |
Definition at line 26 of file AddLabels.php.
Referenced by ILIAS\Refinery\Container\AddLabels\__construct().
|
protected |
Definition at line 21 of file AddLabels.php.
Referenced by ILIAS\Refinery\Container\AddLabels\__construct().