1 | <?php |
||
32 | trait SetTrait |
||
33 | { |
||
34 | use AbstractTrait; |
||
35 | |||
36 | /** |
||
37 | * data storage |
||
38 | * |
||
39 | * @var array |
||
40 | * @access protected |
||
41 | */ |
||
42 | protected $set_data = []; |
||
43 | |||
44 | /** |
||
45 | * data row number |
||
46 | * |
||
47 | * @var int |
||
48 | * @access protected |
||
49 | */ |
||
50 | protected $set_row = 0; |
||
51 | |||
52 | /** |
||
53 | * storage for col names |
||
54 | * |
||
55 | * @var array |
||
56 | * @access protected |
||
57 | */ |
||
58 | protected $set_col = []; |
||
59 | |||
60 | /** |
||
61 | * {@inheritDoc} |
||
62 | */ |
||
63 | public function set($col, $value = ClauseInterface::NO_VALUE) |
||
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | public function setRaw(/*# string */ $col, $value = ClauseInterface::NO_VALUE) |
||
88 | |||
89 | /** |
||
90 | * {@inheritDoc} |
||
91 | */ |
||
92 | public function setTpl(/*# string */ $col, /*# string */ $template, $field) |
||
97 | |||
98 | /** |
||
99 | * Batch SET |
||
100 | * |
||
101 | * @param array $data |
||
102 | * @return $this |
||
103 | * @access protected |
||
104 | */ |
||
105 | protected function setWithArrayData(array $data) |
||
119 | |||
120 | /** |
||
121 | * Build SET |
||
122 | * |
||
123 | * @param string $prefix |
||
124 | * @param array $settings |
||
125 | * @return string |
||
126 | * @access protected |
||
127 | */ |
||
128 | protected function buildSet( |
||
138 | |||
139 | /** |
||
140 | * Build SET for INSERT |
||
141 | * |
||
142 | * @param string $prefix |
||
143 | * @param array $settings |
||
144 | * @return string |
||
145 | * @access protected |
||
146 | */ |
||
147 | protected function buildInsertSet( |
||
161 | |||
162 | /** |
||
163 | * Build SET ... = ..., ... = ... |
||
164 | * |
||
165 | * |
||
166 | * @param string $prefix |
||
167 | * @param array $settings |
||
168 | * @return string |
||
169 | * @access protected |
||
170 | */ |
||
171 | protected function buildUpdateSet( |
||
186 | |||
187 | /** |
||
188 | * Build VALUES ( ... ) |
||
189 | * |
||
190 | * @param string $prefix |
||
191 | * @param array $settings |
||
192 | * @return string |
||
193 | * @access protected |
||
194 | */ |
||
195 | protected function buildValues( |
||
212 | |||
213 | /** |
||
214 | * Get NULL or DEFAULT for values base on the settings |
||
215 | * |
||
216 | * @param array $settings |
||
217 | * @return string |
||
218 | * @access protected |
||
219 | */ |
||
220 | protected function nullOrDefault(array $settings)/*# : string */ |
||
224 | } |
||
225 |