| @@ 190-199 (lines=10) @@ | ||
| 187 | * |
|
| 188 | * @return int ID |
|
| 189 | */ |
|
| 190 | public function insertNewField(Content $content, Field $field, StorageFieldValue $value) |
|
| 191 | { |
|
| 192 | try { |
|
| 193 | return $this->innerGateway->insertNewField($content, $field, $value); |
|
| 194 | } catch (DBALException $e) { |
|
| 195 | throw new RuntimeException('Database error', 0, $e); |
|
| 196 | } catch (PDOException $e) { |
|
| 197 | throw new RuntimeException('Database error', 0, $e); |
|
| 198 | } |
|
| 199 | } |
|
| 200 | ||
| 201 | /** |
|
| 202 | * Inserts an existing field. |
|
| @@ 210-219 (lines=10) @@ | ||
| 207 | * @param Field $field |
|
| 208 | * @param StorageFieldValue $value |
|
| 209 | */ |
|
| 210 | public function insertExistingField(Content $content, Field $field, StorageFieldValue $value) |
|
| 211 | { |
|
| 212 | try { |
|
| 213 | return $this->innerGateway->insertExistingField($content, $field, $value); |
|
| 214 | } catch (DBALException $e) { |
|
| 215 | throw new RuntimeException('Database error', 0, $e); |
|
| 216 | } catch (PDOException $e) { |
|
| 217 | throw new RuntimeException('Database error', 0, $e); |
|
| 218 | } |
|
| 219 | } |
|
| 220 | ||
| 221 | /** |
|
| 222 | * Updates an existing field. |
|
| @@ 227-236 (lines=10) @@ | ||
| 224 | * @param Field $field |
|
| 225 | * @param StorageFieldValue $value |
|
| 226 | */ |
|
| 227 | public function updateField(Field $field, StorageFieldValue $value) |
|
| 228 | { |
|
| 229 | try { |
|
| 230 | return $this->innerGateway->updateField($field, $value); |
|
| 231 | } catch (DBALException $e) { |
|
| 232 | throw new RuntimeException('Database error', 0, $e); |
|
| 233 | } catch (PDOException $e) { |
|
| 234 | throw new RuntimeException('Database error', 0, $e); |
|
| 235 | } |
|
| 236 | } |
|
| 237 | ||
| 238 | /** |
|
| 239 | * Updates an existing, non-translatable field. |
|
| @@ 245-257 (lines=13) @@ | ||
| 242 | * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue $value |
|
| 243 | * @param int $contentId |
|
| 244 | */ |
|
| 245 | public function updateNonTranslatableField( |
|
| 246 | Field $field, |
|
| 247 | StorageFieldValue $value, |
|
| 248 | $contentId |
|
| 249 | ) { |
|
| 250 | try { |
|
| 251 | return $this->innerGateway->updateNonTranslatableField($field, $value, $contentId); |
|
| 252 | } catch (DBALException $e) { |
|
| 253 | throw new RuntimeException('Database error', 0, $e); |
|
| 254 | } catch (PDOException $e) { |
|
| 255 | throw new RuntimeException('Database error', 0, $e); |
|
| 256 | } |
|
| 257 | } |
|
| 258 | ||
| 259 | /** |
|
| 260 | * Loads data for a content object. |
|