1 | <?php |
||
33 | trait SetTrait |
||
34 | { |
||
35 | use AbstractTrait; |
||
36 | |||
37 | /** |
||
38 | * data storage |
||
39 | * |
||
40 | * @var array |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected $set_data = []; |
||
44 | |||
45 | /** |
||
46 | * data row number |
||
47 | * |
||
48 | * @var int |
||
49 | * @access protected |
||
50 | */ |
||
51 | protected $set_row = 0; |
||
52 | |||
53 | /** |
||
54 | * storage for col names |
||
55 | * |
||
56 | * @var array |
||
57 | * @access protected |
||
58 | */ |
||
59 | protected $set_col = []; |
||
60 | |||
61 | /** |
||
62 | * {@inheritDoc} |
||
63 | */ |
||
64 | public function set($col, $value = ClauseInterface::NO_VALUE) |
||
78 | |||
79 | /** |
||
80 | * {@inheritDoc} |
||
81 | */ |
||
82 | public function setRaw( |
||
92 | |||
93 | /** |
||
94 | * {@inheritDoc} |
||
95 | */ |
||
96 | public function setTpl( |
||
105 | |||
106 | /** |
||
107 | * Batch SET |
||
108 | * |
||
109 | * @param array $data |
||
110 | * @return $this |
||
111 | * @access protected |
||
112 | */ |
||
113 | protected function setWithArrayData(array $data) |
||
127 | |||
128 | /** |
||
129 | * Build SET |
||
130 | * |
||
131 | * @param string $prefix |
||
132 | * @param array $settings |
||
133 | * @return string |
||
134 | * @access protected |
||
135 | */ |
||
136 | protected function buildSet( |
||
146 | |||
147 | /** |
||
148 | * Build SET for INSERT |
||
149 | * |
||
150 | * @param string $prefix |
||
151 | * @param array $settings |
||
152 | * @return string |
||
153 | * @access protected |
||
154 | */ |
||
155 | protected function buildInsertSet( |
||
169 | |||
170 | /** |
||
171 | * Build SET ... = ..., ... = ... |
||
172 | * |
||
173 | * |
||
174 | * @param string $prefix |
||
175 | * @param array $settings |
||
176 | * @return string |
||
177 | * @access protected |
||
178 | */ |
||
179 | protected function buildUpdateSet( |
||
196 | |||
197 | /** |
||
198 | * Build VALUES ( ... ) |
||
199 | * |
||
200 | * @param string $prefix |
||
201 | * @param array $settings |
||
202 | * @return string |
||
203 | * @access protected |
||
204 | */ |
||
205 | protected function buildValues( |
||
222 | |||
223 | /** |
||
224 | * Get NULL or DEFAULT for values base on the settings |
||
225 | * |
||
226 | * @param array $settings |
||
227 | * @return string |
||
228 | * @access protected |
||
229 | */ |
||
230 | protected function nullOrDefault(array $settings)/*# : string */ |
||
234 | } |
||
235 |