@@ 134-145 (lines=12) @@ | ||
131 | return $check && $check['cnt'] > 0; |
|
132 | } |
|
133 | ||
134 | protected function doInsert(Sql $sql, $path, $value, $context) |
|
135 | { |
|
136 | $insert = $sql->insert(self::TABLE); |
|
137 | $insert->values([ |
|
138 | 'path' => $path, |
|
139 | 'value' => $value, |
|
140 | 'context' => $context |
|
141 | ]); |
|
142 | $insert = $insert->getSqlString($this->adapter->getPlatform()); |
|
143 | ||
144 | $this->adapter->query($insert)->execute(); |
|
145 | } |
|
146 | ||
147 | protected function doUpdate(Sql $sql, $path, $value, $context) |
|
148 | { |
|
@@ 147-156 (lines=10) @@ | ||
144 | $this->adapter->query($insert)->execute(); |
|
145 | } |
|
146 | ||
147 | protected function doUpdate(Sql $sql, $path, $value, $context) |
|
148 | { |
|
149 | $update = $sql->update(self::TABLE); |
|
150 | $update->set([ |
|
151 | 'value' => $value |
|
152 | ])->where(['path' => $path, 'context' => $context]); |
|
153 | ||
154 | $update = $update->getSqlString($this->adapter->getPlatform()); |
|
155 | $this->adapter->query($update)->execute(); |
|
156 | } |
|
157 | ||
158 | public function create() |
|
159 | { |