ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ 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
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
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
DateTimeTransformation.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Refinery\To\Transformation
;
5
6
use
ILIAS\Data\Factory
;
7
use
ILIAS\Data\Result
;
8
use
ILIAS\Refinery\Transformation
;
9
use
ILIAS\Refinery\DeriveApplyToFromTransform
;
10
use
ILIAS\Refinery\DeriveInvokeFromTransform
;
11
16
class
DateTimeTransformation
implements
Transformation
17
{
18
use
DeriveApplyToFromTransform
;
19
use
DeriveInvokeFromTransform
;
20
24
private
$factory
;
25
29
public
function
__construct
(
Factory
$factory
)
30
{
31
$this->factory =
$factory
;
32
}
33
37
public
function
transform
($from)
38
{
39
try
{
40
return
new \DateTimeImmutable($from);
41
}
catch
(\
Exception
$e
) {
42
throw
new \InvalidArgumentException($e->getMessage(), 1);
43
}
44
}
45
}
ILIAS\Refinery\To\Transformation\DateTimeTransformation\$factory
$factory
Definition:
DateTimeTransformation.php:24
ILIAS\Data\Result
Definition:
Error.php:4
ILIAS\Refinery\To\Transformation\DateTimeTransformation\__construct
__construct(Factory $factory)
Definition:
DateTimeTransformation.php:29
Vendor\Package\$e
$e
Definition:
example_cleaned.php:31
Transformation
ILIAS\Refinery\DeriveApplyToFromTransform
trait DeriveApplyToFromTransform
Definition:
DeriveApplyToFromTransform.php:13
ILIAS\Refinery\To\Transformation
Definition:
BooleanTransformation.php:10
ILIAS\Refinery\DeriveInvokeFromTransform
trait DeriveInvokeFromTransform
Definition:
DeriveInvokeFromTransform.php:13
Factory
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:19
ILIAS\Refinery\To\Transformation\DateTimeTransformation
Transform a string representing a datetime-value to php's DateTimeImmutable see https://www.php.net/manual/de/datetime.formats.php.
Definition:
DateTimeTransformation.php:16
ILIAS\Refinery\To\Transformation\DateTimeTransformation\transform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Definition:
DateTimeTransformation.php:37
ILIAS\Refinery\Transformation
A transformation is a function from one datatype to another.
Definition:
Transformation.php:17
Exception
src
Refinery
To
Transformation
DateTimeTransformation.php
Generated on Sat Apr 12 2025 21:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)