ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
NewMethodTransformation.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
5
10
namespace
ILIAS\Refinery\To\Transformation
;
11
12
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
13
use
ILIAS\Refinery\Transformation
;
14
use
ILIAS\Refinery\ConstraintViolationException
;
15
16
class
NewMethodTransformation
implements
Transformation
17
{
18
use
DeriveApplyToFromTransform
;
19
23
private
$object
;
24
28
private
$method
;
29
34
public
function
__construct
(
object
$object
,
string
$methodToCall)
35
{
36
if
(
false
=== method_exists($object, $methodToCall)) {
37
throw
new \InvalidArgumentException(
38
'The second parameter MUST be an method of the object'
39
);
40
}
41
42
$this->
object
=
$object
;
43
$this->method = $methodToCall;
44
}
45
50
public
function
transform
($from)
51
{
52
if
(
false
=== is_array($from)) {
53
$from = array($from);
54
}
55
56
return
call_user_func_array(array($this->
object
, $this->method), $from);
57
}
58
62
public
function
__invoke
($from)
63
{
64
return
$this->
transform
($from);
65
}
66
}
ILIAS\Refinery\To\Transformation\NewMethodTransformation\transform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition:
NewMethodTransformation.php:50
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:10
ILIAS\Refinery\To\Transformation\NewMethodTransformation\__invoke
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
Definition:
NewMethodTransformation.php:62
ILIAS\Refinery\To\Transformation\NewMethodTransformation
Definition:
NewMethodTransformation.php:16
ILIAS\Refinery\To\Transformation\NewMethodTransformation\$method
$method
Definition:
NewMethodTransformation.php:28
ILIAS\Refinery\To\Transformation\NewMethodTransformation\__construct
__construct(object $object, string $methodToCall)
Definition:
NewMethodTransformation.php:34
ILIAS\Refinery\To\Transformation\NewMethodTransformation\$object
$object
Definition:
NewMethodTransformation.php:23
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:17
ConstraintViolationException
src
Refinery
To
Transformation
NewMethodTransformation.php
Generated on Sat Apr 5 2025 20:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)