@@ 199-213 (lines=15) @@ | ||
196 | /** |
|
197 | * @inheritDoc |
|
198 | */ |
|
199 | public function createEntry($tableName, array $data) |
|
200 | { |
|
201 | $tableGateway = $this->getTableGateway($tableName); |
|
202 | $data = $this->processData($tableName, $data); |
|
203 | ||
204 | foreach($data as $key => $value) { |
|
205 | if ($value instanceof File) { |
|
206 | $data[$key] = $this->processFile($value); |
|
207 | } |
|
208 | } |
|
209 | ||
210 | $newRecord = $tableGateway->manageRecordUpdate($tableName, $data); |
|
211 | ||
212 | return $this->getEntry($tableName, $newRecord[$tableGateway->primaryKeyFieldName]); |
|
213 | } |
|
214 | ||
215 | /** |
|
216 | * @inheritDoc |
|
@@ 218-232 (lines=15) @@ | ||
215 | /** |
|
216 | * @inheritDoc |
|
217 | */ |
|
218 | public function updateEntry($tableName, $id, array $data) |
|
219 | { |
|
220 | $tableGateway = $this->getTableGateway($tableName); |
|
221 | $data = $this->processData($tableName, $data); |
|
222 | ||
223 | foreach($data as $key => $value) { |
|
224 | if ($value instanceof File) { |
|
225 | $data[$key] = $this->processFile($value); |
|
226 | } |
|
227 | } |
|
228 | ||
229 | $updatedRecord = $tableGateway->manageRecordUpdate($tableName, array_merge($data, ['id' => $id])); |
|
230 | ||
231 | return $this->getEntry($tableName, $updatedRecord[$tableGateway->primaryKeyFieldName]); |
|
232 | } |
|
233 | ||
234 | /** |
|
235 | * @inheritDoc |