ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Transformation.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 2017 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Refinery\Custom
;
5
6
use
ILIAS\Data\Factory
;
7
use
ILIAS\Data\Result
;
8
use
ILIAS\Refinery\Transformation
as
TransformationInterface
;
9
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
10
14
class
Transformation
implements
TransformationInterface
15
{
16
use
DeriveApplyToFromTransform
;
17
21
protected
$transform
;
22
private
$factory
;
23
28
public
function
__construct
(callable
$transform
,
Factory
$factory
)
29
{
30
$this->
transform
=
$transform
;
31
$this->factory =
$factory
;
32
}
33
37
public
function
transform
($from)
38
{
39
return
call_user_func($this->
transform
, $from);
40
}
41
45
public
function
__invoke
($from)
46
{
47
return
$this->
transform
($from);
48
}
49
}
ILIAS\Refinery\Custom\Transformation\__invoke
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
Definition:
Transformation.php:45
ILIAS\Refinery\Custom
Definition:
Constraint.php:4
ILIAS\Refinery\Custom\Transformation
Transform values according to custom configuration.
Definition:
Transformation.php:14
ILIAS\Data\Result
Definition:
Error.php:4
ILIAS\Refinery\Custom\Transformation\__construct
__construct(callable $transform, Factory $factory)
Definition:
Transformation.php:28
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\Custom\Transformation\transform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition:
Transformation.php:37
Factory
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:19
ILIAS\Refinery\Custom\Transformation\$transform
$transform
Definition:
Transformation.php:21
ILIAS\Refinery\Custom\Transformation\$factory
$factory
Definition:
Transformation.php:22
src
Refinery
Custom
Transformation.php
Generated on Wed Sep 3 2025 20:01:28 for ILIAS by
1.8.13 (using
Doxyfile
)