ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
NewObjectTransformation.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Refinery\To\Transformation
;
22
23
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
24
use
ILIAS\Refinery\Transformation
;
25
use ReflectionClass;
26
use ReflectionException;
27
28
class
NewObjectTransformation
implements
Transformation
29
{
30
use
DeriveApplyToFromTransform
;
31
32
private
string
$className
;
33
34
public
function
__construct
(
string
$className
)
35
{
36
$this->className =
$className
;
37
}
38
43
public
function
transform
($from)
44
{
45
$class =
new
ReflectionClass($this->className);
46
$instance = $class->newInstanceArgs($from);
47
48
return
$instance;
49
}
50
55
public
function
__invoke
($from)
56
{
57
return
$this->
transform
($from);
58
}
59
}
ILIAS\Refinery\To\Transformation\NewObjectTransformation
Definition:
NewObjectTransformation.php:29
ILIAS\Refinery\To\Transformation\NewObjectTransformation\__construct
__construct(string $className)
Definition:
NewObjectTransformation.php:34
ILIAS\Refinery\To\Transformation\NewObjectTransformation\transform
transform($from)
@inheritDoc
Definition:
NewObjectTransformation.php:43
ILIAS\Refinery\To\Transformation\NewObjectTransformation\__invoke
__invoke($from)
@inheritDoc
Definition:
NewObjectTransformation.php:55
ILIAS\Refinery\To\Transformation\NewObjectTransformation\$className
string $className
Definition:
NewObjectTransformation.php:32
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:29
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:35
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:21
components
ILIAS
Refinery
src
To
Transformation
NewObjectTransformation.php
Generated on Sat Oct 18 2025 23:03:35 for ILIAS by
1.9.4 (using
Doxyfile
)