1 | <?php |
||
8 | class PlatformFunction implements Operand |
||
9 | { |
||
10 | /** |
||
11 | * Doctrine internal functions. |
||
12 | * |
||
13 | * @see \Doctrine\ORM\Query\Parser |
||
14 | * |
||
15 | * @var string[] |
||
16 | */ |
||
17 | private static $doctrineFunctions = [ |
||
18 | // String functions |
||
19 | 'concat', |
||
20 | 'substring', |
||
21 | 'trim', |
||
22 | 'lower', |
||
23 | 'upper', |
||
24 | 'identity', |
||
25 | // Numeric functions |
||
26 | 'length', |
||
27 | 'locate', |
||
28 | 'abs', |
||
29 | 'sqrt', |
||
30 | 'mod', |
||
31 | 'size', |
||
32 | 'date_diff', |
||
33 | 'bit_and', |
||
34 | 'bit_or', |
||
35 | // Aggregate functions |
||
36 | 'min', |
||
37 | 'max', |
||
38 | 'avg', |
||
39 | 'sum', |
||
40 | 'count', |
||
41 | // Datetime functions |
||
42 | 'current_date', |
||
43 | 'current_time', |
||
44 | 'current_timestamp', |
||
45 | 'date_add', |
||
46 | 'date_sub', |
||
47 | ]; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $functionName = ''; |
||
53 | |||
54 | /** |
||
55 | * @var array |
||
56 | */ |
||
57 | private $arguments = []; |
||
58 | |||
59 | /** |
||
60 | * @param string $functionName |
||
61 | * @param mixed $arguments |
||
62 | */ |
||
63 | public function __construct($functionName, $arguments = []) |
||
74 | |||
75 | /** |
||
76 | * @param QueryBuilder $qb |
||
77 | * @param string $dqlAlias |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function transform(QueryBuilder $qb, $dqlAlias) |
||
98 | } |
||
99 |