ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
NewObjectTransformation.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
9
namespace
ILIAS\Refinery\To\Transformation
;
10
11
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
12
use
ILIAS\Refinery\Transformation
;
13
14
class
NewObjectTransformation
implements
Transformation
15
{
16
use
DeriveApplyToFromTransform
;
17
18
private
$className
;
19
23
public
function
__construct
(
string
$className
)
24
{
25
$this->className =
$className
;
26
}
27
32
public
function
transform
($from)
33
{
34
$class = new \ReflectionClass($this->className);
35
$instance = $class->newInstanceArgs($from);
36
37
return
$instance;
38
}
39
44
public
function
__invoke
($from)
45
{
46
return
$this->
transform
($from);
47
}
48
}
ILIAS\Refinery\To\Transformation\NewObjectTransformation\__construct
__construct(string $className)
Definition:
NewObjectTransformation.php:23
ILIAS\Refinery\To\Transformation\NewObjectTransformation\$className
$className
Definition:
NewObjectTransformation.php:18
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\To\Transformation\NewObjectTransformation\__invoke
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
Definition:
NewObjectTransformation.php:44
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:10
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:17
ILIAS\Refinery\To\Transformation\NewObjectTransformation
Definition:
NewObjectTransformation.php:14
ILIAS\Refinery\To\Transformation\NewObjectTransformation\transform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition:
NewObjectTransformation.php:32
src
Refinery
To
Transformation
NewObjectTransformation.php
Generated on Wed Sep 3 2025 21:01:45 for ILIAS by
1.8.13 (using
Doxyfile
)