Conditions | 9 |
Paths | 23 |
Total Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 90 |
Changes | 0 |
1 | <?php |
||
28 | public function parseUpdate() |
||
29 | { |
||
30 | if (!$this->parts['data']) { |
||
31 | return false; |
||
32 | } |
||
33 | $fields = []; |
||
34 | foreach ($this->parts['data'] as $data) { |
||
35 | foreach ($data as $key => $values) { |
||
36 | if (!is_array($values)) { |
||
37 | $values = [$values]; |
||
38 | } |
||
39 | $value = $values[0]; |
||
40 | $quote = isset($values[1]) ? $values[1] : null; |
||
41 | |||
42 | if (!is_numeric($value)) { |
||
43 | if (is_null($quote)) { |
||
44 | $quote = true; |
||
45 | } |
||
46 | if ($quote) { |
||
47 | $value = $this->getManager()->getAdapter()->quote($value); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | $fields[] = "{$this->protect($key)} = $value"; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | return implode(", ", $fields); |
||
56 | } |
||
57 | } |
||
58 |