1 | <?php |
||
13 | abstract class Statement |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $values = []; |
||
19 | |||
20 | /** |
||
21 | * Generates the raw SQL string for the statement. |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | abstract public function build(); |
||
26 | |||
27 | /** |
||
28 | * Gets the values associated with this statement. |
||
29 | * |
||
30 | * @return array |
||
31 | */ |
||
32 | public function getValues() |
||
36 | |||
37 | /** |
||
38 | * Escapes potentially reserved keywords in identifiers by wrapping them |
||
39 | * with the escape character as necessary. |
||
40 | * |
||
41 | * @param string $word |
||
42 | * @param string $escapeChar |
||
43 | * |
||
44 | * @return string escaped identifier |
||
45 | */ |
||
46 | protected function escapeIdentifier($word, $escapeChar = '`') |
||
75 | |||
76 | /** |
||
77 | * Parameterizes a function using indexed placeholders. |
||
78 | * |
||
79 | * @param string $value |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | protected function parameterize($value) |
||
90 | |||
91 | /** |
||
92 | * Parameterizes a list of values. |
||
93 | * |
||
94 | * @param array $values |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | protected function parameterizeValues(array $values) |
||
106 | } |
||
107 |