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