@@ 208-216 (lines=9) @@ | ||
205 | * @param array $fields |
|
206 | * @return Builder\RunnableSelect |
|
207 | */ |
|
208 | public function select(array $fields = null) { |
|
209 | $select = array_key_exists('select-factory', $this->options) |
|
210 | ? call_user_func($this->options['select-factory'], $this, $this->options['select-options']) |
|
211 | : new Builder\RunnableSelect($this, $this->options['select-options']); |
|
212 | if($fields !== null) { |
|
213 | $select->fields($fields); |
|
214 | } |
|
215 | return $select; |
|
216 | } |
|
217 | ||
218 | /** |
|
219 | * @param array $fields |
|
@@ 222-230 (lines=9) @@ | ||
219 | * @param array $fields |
|
220 | * @return Builder\RunnableInsert |
|
221 | */ |
|
222 | public function insert(array $fields = null) { |
|
223 | $insert = array_key_exists('insert-factory', $this->options) |
|
224 | ? call_user_func($this->options['insert-factory'], $this, $this->options['insert-options']) |
|
225 | : new Builder\RunnableInsert($this, $this->options['insert-options']); |
|
226 | if($fields !== null) { |
|
227 | $insert->addAll($fields); |
|
228 | } |
|
229 | return $insert; |
|
230 | } |
|
231 | ||
232 | /** |
|
233 | * @param array $fields |
|
@@ 236-244 (lines=9) @@ | ||
233 | * @param array $fields |
|
234 | * @return Builder\RunnableUpdate |
|
235 | */ |
|
236 | public function update(array $fields = null) { |
|
237 | $update = array_key_exists('update-factory', $this->options) |
|
238 | ? call_user_func($this->options['update-factory'], $this, $this->options['update-options']) |
|
239 | : new Builder\RunnableUpdate($this, $this->options['update-options']); |
|
240 | if($fields !== null) { |
|
241 | $update->setAll($fields); |
|
242 | } |
|
243 | return $update; |
|
244 | } |
|
245 | ||
246 | /** |
|
247 | * @return Builder\RunnableDelete |