@@ 24-35 (lines=12) @@ | ||
21 | * |
|
22 | * @return self |
|
23 | */ |
|
24 | public function data(array $data, array &$prepared = null) |
|
25 | { |
|
26 | $this->data = $this->table->prepareDataToDatabase($data, true); |
|
27 | ||
28 | if (is_array($prepared)) { |
|
29 | foreach ($this->data as $field => $value) { |
|
30 | $prepared[$field] = $this->table->$field->dataFromDatabase($value); |
|
31 | } |
|
32 | } |
|
33 | ||
34 | return $this; |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * Set true to handle duplications. |
@@ 26-37 (lines=12) @@ | ||
23 | * |
|
24 | * @return self |
|
25 | */ |
|
26 | public function data(array $data, array &$prepared = null) |
|
27 | { |
|
28 | $this->data = $this->table->prepareDataToDatabase($data, false); |
|
29 | ||
30 | if (is_array($prepared)) { |
|
31 | foreach ($this->data as $field => $value) { |
|
32 | $prepared[$field] = $this->table->$field->dataFromDatabase($value); |
|
33 | } |
|
34 | } |
|
35 | ||
36 | return $this; |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * Adds new marks to the query. |