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