-
Notifications
You must be signed in to change notification settings - Fork 0
/
Upper.php
48 lines (42 loc) · 853 Bytes
/
Upper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace ModernPDO\Functions\Scalar\String;
use ModernPDO\Escaper;
use ModernPDO\Functions\Scalar\ScalarFunction;
/**
* Function to get upper string.
*/
class Upper extends ScalarFunction
{
/**
* Upper function constructor.
*/
public function __construct(
private string $column,
) {
}
/**
* Returns upper function query.
*/
public function build(Escaper $escaper): string
{
return 'UPPER(' . $escaper->column($this->column) . ')';
}
/**
* Returns prepared function query.
*/
public function buildQuery(): string
{
return 'UPPER(?)';
}
/**
* Returns parameters for function.
*
* @return list<mixed>
*/
public function buildParams(): array
{
return [
$this->column,
];
}
}