1 | <?php |
||
19 | class PlatformFunction implements Operand |
||
20 | { |
||
21 | /** |
||
22 | * Doctrine internal functions. |
||
23 | * |
||
24 | * @see \Doctrine\ORM\Query\Parser |
||
25 | * |
||
26 | * @var string[] |
||
27 | */ |
||
28 | private static $doctrineFunctions = [ |
||
29 | // String functions |
||
30 | 'concat', |
||
31 | 'substring', |
||
32 | 'trim', |
||
33 | 'lower', |
||
34 | 'upper', |
||
35 | 'identity', |
||
36 | // Numeric functions |
||
37 | 'length', |
||
38 | 'locate', |
||
39 | 'abs', |
||
40 | 'sqrt', |
||
41 | 'mod', |
||
42 | 'size', |
||
43 | 'date_diff', |
||
44 | 'bit_and', |
||
45 | 'bit_or', |
||
46 | // Aggregate functions |
||
47 | 'min', |
||
48 | 'max', |
||
49 | 'avg', |
||
50 | 'sum', |
||
51 | 'count', |
||
52 | // Datetime functions |
||
53 | 'current_date', |
||
54 | 'current_time', |
||
55 | 'current_timestamp', |
||
56 | 'date_add', |
||
57 | 'date_sub', |
||
58 | ]; |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | */ |
||
63 | private $functionName = ''; |
||
64 | |||
65 | /** |
||
66 | * @var array |
||
67 | */ |
||
68 | private $arguments = []; |
||
69 | |||
70 | /** |
||
71 | * @param string $functionName |
||
72 | * @param mixed $arguments |
||
73 | */ |
||
74 | public function __construct($functionName, $arguments = []) |
||
86 | |||
87 | /** |
||
88 | * @param QueryBuilder $qb |
||
89 | * @param string $dqlAlias |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function transform(QueryBuilder $qb, $dqlAlias) |
||
110 | } |
||
111 |