Conditions | 4 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 4 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
66 | 9 | public function set(QueryInterface $query) |
|
67 | { |
||
68 | 9 | if ($this->timestamp) |
|
69 | 6 | { |
|
70 | 9 | $this->data[static::UPDATED_AT] = date($this->dateFormat); |
|
71 | 6 | } |
|
72 | |||
73 | 9 | $query = $query->update($this->table); |
|
74 | |||
75 | 9 | foreach ($this->data as $key => $value) |
|
76 | { |
||
77 | 9 | if ($this->primary === $key) |
|
78 | 6 | { |
|
79 | 6 | continue; |
|
80 | } |
||
81 | |||
82 | 9 | $query = $query->set($key, $value); |
|
83 | 6 | } |
|
84 | |||
85 | 9 | $query = $query->where($this->primary); |
|
86 | |||
87 | 9 | return $query->equals((integer) $this->id); |
|
88 | } |
||
90 |