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) |
||
74 | |||
75 | /** |
||
76 | * {@inheritDoc} |
||
77 | */ |
||
78 | public function setRaw(/*# string */ $col, $value = ClauseInterface::NO_VALUE) |
||
90 | |||
91 | /** |
||
92 | * {@inheritDoc} |
||
93 | */ |
||
94 | public function setTpl(/*# string */ $col, /*# string */ $template, $field) |
||
102 | |||
103 | /** |
||
104 | * Batch SET |
||
105 | * |
||
106 | * @param array $data |
||
107 | * @return $this |
||
108 | * @access protected |
||
109 | */ |
||
110 | protected function setWithArrayData(array $data) |
||
124 | |||
125 | /** |
||
126 | * Build SET |
||
127 | * |
||
128 | * @param string $prefix |
||
129 | * @param array $settings |
||
130 | * @return string |
||
131 | * @access protected |
||
132 | */ |
||
133 | protected function buildSet( |
||
143 | |||
144 | /** |
||
145 | * Build SET for INSERT |
||
146 | * |
||
147 | * @param string $prefix |
||
148 | * @param array $settings |
||
149 | * @return string |
||
150 | * @access protected |
||
151 | */ |
||
152 | protected function buildInsertSet( |
||
166 | |||
167 | /** |
||
168 | * Build SET ... = ..., ... = ... |
||
169 | * |
||
170 | * |
||
171 | * @param string $prefix |
||
172 | * @param array $settings |
||
173 | * @return string |
||
174 | * @access protected |
||
175 | */ |
||
176 | protected function buildUpdateSet( |
||
191 | |||
192 | /** |
||
193 | * Build VALUES ( ... ) |
||
194 | * |
||
195 | * @param string $prefix |
||
196 | * @param array $settings |
||
197 | * @return string |
||
198 | * @access protected |
||
199 | */ |
||
200 | protected function buildValues( |
||
217 | |||
218 | /** |
||
219 | * Get NULL or DEFAULT for values base on the settings |
||
220 | * |
||
221 | * @param array $settings |
||
222 | * @return string |
||
223 | * @access protected |
||
224 | */ |
||
225 | protected function nullOrDefault(array $settings)/*# : string */ |
||
229 | } |
||
230 |