Passed
Push — master ( b07fd7...222f48 )
by y
01:35
created

Text::toDateTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Helix\DB\SQL;
4
5
/**
6
 * Represents a text expression. Produces various transformations.
7
 */
8
class Text extends Value {
9
10
    use TextTrait;
11
12
    /**
13
     * Interpret the expression as a datetime.
14
     *
15
     * > Warning: If the expression is in the local timezone
16
     * > you should chain this with {@link DateTime::toUtc()}
17
     *
18
     * SQLite:
19
     * - The expression's value must conform to one of any `time-value` formats.
20
     * - https://www.sqlite.org/lang_datefunc.html
21
     *
22
     * MySQL:
23
     * - The expression's value must conform to `YYYY-MM-DD hh:mm:ss`
24
     *
25
     * @return DateTime
26
     */
27
    public function toDateTime () {
28
        return DateTime::factory($this->db, $this);
29
    }
30
}