ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ 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\__construct
__construct(string $className)
Definition:
NewObjectTransformation.php:34
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:29
ILIAS\Refinery\To\Transformation\NewObjectTransformation\$className
string $className
Definition:
NewObjectTransformation.php:32
Transformation
ILIAS\Refinery\To\Transformation\NewObjectTransformation\__invoke
__invoke($from)
Definition:
NewObjectTransformation.php:55
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:21
ReflectionClass
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:34
ILIAS\Refinery\To\Transformation\NewObjectTransformation
Definition:
NewObjectTransformation.php:28
ILIAS\Refinery\To\Transformation\NewObjectTransformation\transform
transform($from)
Definition:
NewObjectTransformation.php:43
ReflectionException
components
ILIAS
Refinery
src
To
Transformation
NewObjectTransformation.php
Generated on Mon Sep 1 2025 23:03:41 for ILIAS by
1.8.13 (using
Doxyfile
)