Code Duplication    Length = 10-10 lines in 161 locations

eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/ExceptionConversion.php 22 locations

@@ 424-433 (lines=10) @@
421
    /**
422
     * {@inheritdoc}
423
     */
424
    public function archiveUrlAliasesForDeletedTranslations($locationId, $parentId, array $languageIds)
425
    {
426
        try {
427
            $this->innerGateway->archiveUrlAliasesForDeletedTranslations($locationId, $parentId, $languageIds);
428
        } catch (DBALException $e) {
429
            throw new \RuntimeException('Database error', 0, $e);
430
        } catch (PDOException $e) {
431
            throw new \RuntimeException('Database error', 0, $e);
432
        }
433
    }
434
435
    /**
436
     * {@inheritdoc}
@@ 38-47 (lines=10) @@
35
        $this->innerGateway = $innerGateway;
36
    }
37
38
    public function setTable($name)
39
    {
40
        try {
41
            return $this->innerGateway->setTable($name);
42
        } catch (DBALException $e) {
43
            throw new \RuntimeException('Database error', 0, $e);
44
        } catch (PDOException $e) {
45
            throw new \RuntimeException('Database error', 0, $e);
46
        }
47
    }
48
49
    /**
50
     * Loads list of aliases by given $locationId.
@@ 58-67 (lines=10) @@
55
     *
56
     * @return array
57
     */
58
    public function loadLocationEntries($locationId, $custom = false, $languageId = false)
59
    {
60
        try {
61
            return $this->innerGateway->loadLocationEntries($locationId, $custom);
62
        } catch (DBALException $e) {
63
            throw new \RuntimeException('Database error', 0, $e);
64
        } catch (PDOException $e) {
65
            throw new \RuntimeException('Database error', 0, $e);
66
        }
67
    }
68
69
    /**
70
     * Returns boolean indicating if the row with given $id is special root entry.
@@ 79-88 (lines=10) @@
76
     *
77
     * @return bool
78
     */
79
    public function isRootEntry($id)
80
    {
81
        try {
82
            return $this->innerGateway->isRootEntry($id);
83
        } catch (DBALException $e) {
84
            throw new \RuntimeException('Database error', 0, $e);
85
        } catch (PDOException $e) {
86
            throw new \RuntimeException('Database error', 0, $e);
87
        }
88
    }
89
90
    /**
91
     * Downgrades autogenerated entry matched by given $action and $languageId and negatively matched by
@@ 114-123 (lines=10) @@
111
        }
112
    }
113
114
    public function historizeBeforeSwap($action, $languageMask)
115
    {
116
        try {
117
            $this->innerGateway->historizeBeforeSwap($action, $languageMask);
118
        } catch (DBALException $e) {
119
            throw new \RuntimeException('Database error', 0, $e);
120
        } catch (PDOException $e) {
121
            throw new \RuntimeException('Database error', 0, $e);
122
        }
123
    }
124
125
    /**
126
     * Marks all entries with given $id as history entries.
@@ 134-143 (lines=10) @@
131
     * @param mixed $id
132
     * @param mixed $link
133
     */
134
    public function historizeId($id, $link)
135
    {
136
        try {
137
            $this->innerGateway->historizeId($id, $link);
138
        } catch (DBALException $e) {
139
            throw new \RuntimeException('Database error', 0, $e);
140
        } catch (PDOException $e) {
141
            throw new \RuntimeException('Database error', 0, $e);
142
        }
143
    }
144
145
    /**
146
     * Updates parent id of autogenerated entries.
@@ 153-162 (lines=10) @@
150
     * @param mixed $oldParentId
151
     * @param mixed $newParentId
152
     */
153
    public function reparent($oldParentId, $newParentId)
154
    {
155
        try {
156
            $this->innerGateway->reparent($oldParentId, $newParentId);
157
        } catch (DBALException $e) {
158
            throw new \RuntimeException('Database error', 0, $e);
159
        } catch (PDOException $e) {
160
            throw new \RuntimeException('Database error', 0, $e);
161
        }
162
    }
163
164
    /**
165
     * Updates single row data matched by composite primary key.
@@ 191-200 (lines=10) @@
188
     *
189
     * @return mixed
190
     */
191
    public function insertRow(array $values)
192
    {
193
        try {
194
            return $this->innerGateway->insertRow($values);
195
        } catch (DBALException $e) {
196
            throw new \RuntimeException('Database error', 0, $e);
197
        } catch (PDOException $e) {
198
            throw new \RuntimeException('Database error', 0, $e);
199
        }
200
    }
201
202
    /**
203
     * Loads single row data matched by composite primary key.
@@ 210-219 (lines=10) @@
207
     *
208
     * @return array
209
     */
210
    public function loadRow($parentId, $textMD5)
211
    {
212
        try {
213
            return $this->innerGateway->loadRow($parentId, $textMD5);
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
     * Loads autogenerated entry id by given $action and optionally $parentId.
@@ 229-238 (lines=10) @@
226
     *
227
     * @return array
228
     */
229
    public function loadAutogeneratedEntry($action, $parentId = null)
230
    {
231
        try {
232
            return $this->innerGateway->loadAutogeneratedEntry($action, $parentId);
233
        } catch (DBALException $e) {
234
            throw new \RuntimeException('Database error', 0, $e);
235
        } catch (PDOException $e) {
236
            throw new \RuntimeException('Database error', 0, $e);
237
        }
238
    }
239
240
    /**
241
     * Deletes all rows with given $action and optionally $id.
@@ 289-298 (lines=10) @@
286
     *
287
     * @return bool
288
     */
289
    public function removeCustomAlias($parentId, $textMD5)
290
    {
291
        try {
292
            return $this->innerGateway->removeCustomAlias($parentId, $textMD5);
293
        } catch (DBALException $e) {
294
            throw new \RuntimeException('Database error', 0, $e);
295
        } catch (PDOException $e) {
296
            throw new \RuntimeException('Database error', 0, $e);
297
        }
298
    }
299
300
    /**
301
     * Loads complete URL alias data by given array of path hashes.
@@ 307-316 (lines=10) @@
304
     *
305
     * @return array
306
     */
307
    public function loadUrlAliasData(array $urlHashes)
308
    {
309
        try {
310
            return $this->innerGateway->loadUrlAliasData($urlHashes);
311
        } catch (DBALException $e) {
312
            throw new \RuntimeException('Database error', 0, $e);
313
        } catch (PDOException $e) {
314
            throw new \RuntimeException('Database error', 0, $e);
315
        }
316
    }
317
318
    /**
319
     * Loads all data for the path identified by given $id.
@@ 327-336 (lines=10) @@
324
     *
325
     * @return array
326
     */
327
    public function loadPathData($id)
328
    {
329
        try {
330
            return $this->innerGateway->loadPathData($id);
331
        } catch (DBALException $e) {
332
            throw new \RuntimeException('Database error', 0, $e);
333
        } catch (PDOException $e) {
334
            throw new \RuntimeException('Database error', 0, $e);
335
        }
336
    }
337
338
    /**
339
     * Loads path data identified by given ordered array of hierarchy data.
@@ 350-359 (lines=10) @@
347
     *
348
     * @return array
349
     */
350
    public function loadPathDataByHierarchy(array $hierarchyData)
351
    {
352
        try {
353
            return $this->innerGateway->loadPathDataByHierarchy($hierarchyData);
354
        } catch (DBALException $e) {
355
            throw new \RuntimeException('Database error', 0, $e);
356
        } catch (PDOException $e) {
357
            throw new \RuntimeException('Database error', 0, $e);
358
        }
359
    }
360
361
    /**
362
     * Loads all autogenerated entries with given $parentId with optionally included history entries.
@@ 369-378 (lines=10) @@
366
     *
367
     * @return array
368
     */
369
    public function loadAutogeneratedEntries($parentId, $includeHistory = false)
370
    {
371
        try {
372
            return $this->innerGateway->loadAutogeneratedEntries($parentId, $includeHistory);
373
        } catch (DBALException $e) {
374
            throw new \RuntimeException('Database error', 0, $e);
375
        } catch (PDOException $e) {
376
            throw new \RuntimeException('Database error', 0, $e);
377
        }
378
    }
379
380
    /**
381
     * Returns next value for "id" column.
@@ 385-394 (lines=10) @@
382
     *
383
     * @return mixed
384
     */
385
    public function getNextId()
386
    {
387
        try {
388
            return $this->innerGateway->getNextId();
389
        } catch (DBALException $e) {
390
            throw new \RuntimeException('Database error', 0, $e);
391
        } catch (PDOException $e) {
392
            throw new \RuntimeException('Database error', 0, $e);
393
        }
394
    }
395
396
    public function getLocationContentMainLanguageId($locationId)
397
    {
@@ 396-405 (lines=10) @@
393
        }
394
    }
395
396
    public function getLocationContentMainLanguageId($locationId)
397
    {
398
        try {
399
            return $this->innerGateway->getLocationContentMainLanguageId($locationId);
400
        } catch (DBALException $e) {
401
            throw new \RuntimeException('Database error', 0, $e);
402
        } catch (PDOException $e) {
403
            throw new \RuntimeException('Database error', 0, $e);
404
        }
405
    }
406
407
    /**
408
     * {@inheritdoc}
@@ 410-419 (lines=10) @@
407
    /**
408
     * {@inheritdoc}
409
     */
410
    public function bulkRemoveTranslation($languageId, $actions)
411
    {
412
        try {
413
            return $this->innerGateway->bulkRemoveTranslation($languageId, $actions);
414
        } catch (DBALException $e) {
415
            throw new \RuntimeException('Database error', 0, $e);
416
        } catch (PDOException $e) {
417
            throw new \RuntimeException('Database error', 0, $e);
418
        }
419
    }
420
421
    /**
422
     * {@inheritdoc}
@@ 438-447 (lines=10) @@
435
    /**
436
     * {@inheritdoc}
437
     */
438
    public function deleteUrlAliasesWithoutLocation()
439
    {
440
        try {
441
            return $this->innerGateway->deleteUrlAliasesWithoutLocation();
442
        } catch (DBALException $e) {
443
            throw new \RuntimeException('Database error', 0, $e);
444
        } catch (PDOException $e) {
445
            throw new \RuntimeException('Database error', 0, $e);
446
        }
447
    }
448
449
    /**
450
     * {@inheritdoc}
@@ 452-461 (lines=10) @@
449
    /**
450
     * {@inheritdoc}
451
     */
452
    public function deleteUrlAliasesWithoutParent()
453
    {
454
        try {
455
            return $this->innerGateway->deleteUrlAliasesWithoutParent();
456
        } catch (DBALException $e) {
457
            throw new \RuntimeException('Database error', 0, $e);
458
        } catch (PDOException $e) {
459
            throw new \RuntimeException('Database error', 0, $e);
460
        }
461
    }
462
463
    /**
464
     * {@inheritdoc}
@@ 466-475 (lines=10) @@
463
    /**
464
     * {@inheritdoc}
465
     */
466
    public function deleteUrlAliasesWithBrokenLink()
467
    {
468
        try {
469
            return $this->innerGateway->deleteUrlAliasesWithBrokenLink();
470
        } catch (DBALException $e) {
471
            throw new \RuntimeException('Database error', 0, $e);
472
        } catch (PDOException $e) {
473
            throw new \RuntimeException('Database error', 0, $e);
474
        }
475
    }
476
477
    /**
478
     * {@inheritdoc}
@@ 480-489 (lines=10) @@
477
    /**
478
     * {@inheritdoc}
479
     */
480
    public function repairBrokenUrlAliasesForLocation($locationId)
481
    {
482
        try {
483
            return $this->innerGateway->repairBrokenUrlAliasesForLocation($locationId);
484
        } catch (DBALException $e) {
485
            throw new \RuntimeException('Database error', 0, $e);
486
        } catch (PDOException $e) {
487
            throw new \RuntimeException('Database error', 0, $e);
488
        }
489
    }
490
}
491

eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/ExceptionConversion.php 2 locations

@@ 104-113 (lines=10) @@
101
     *
102
     * @return array
103
     */
104
    public function loadRoleDraftByRoleId($roleId)
105
    {
106
        try {
107
            return $this->innerGateway->loadRoleDraftByRoleId($roleId);
108
        } catch (DBALException $e) {
109
            throw new RuntimeException('Database error', 0, $e);
110
        } catch (PDOException $e) {
111
            throw new RuntimeException('Database error', 0, $e);
112
        }
113
    }
114
115
    /**
116
     * Loads all roles.
@@ 196-205 (lines=10) @@
193
     *
194
     * @return array
195
     */
196
    public function loadRoleAssignmentsByRoleId($roleId)
197
    {
198
        try {
199
            return $this->innerGateway->loadRoleAssignmentsByRoleId($roleId);
200
        } catch (DBALException $e) {
201
            throw new RuntimeException('Database error', 0, $e);
202
        } catch (PDOException $e) {
203
            throw new RuntimeException('Database error', 0, $e);
204
        }
205
    }
206
207
    /**
208
     * Returns the user policies associated with the user.

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/ExceptionConversion.php 36 locations

@@ 51-60 (lines=10) @@
48
     *
49
     * @return array
50
     */
51
    public function getContext()
52
    {
53
        try {
54
            return $this->innerGateway->getContext();
55
        } catch (DBALException $e) {
56
            throw new RuntimeException('Database error', 0, $e);
57
        } catch (PDOException $e) {
58
            throw new RuntimeException('Database error', 0, $e);
59
        }
60
    }
61
62
    /**
63
     * Inserts a new content object.
@@ 70-79 (lines=10) @@
67
     *
68
     * @return int ID
69
     */
70
    public function insertContentObject(CreateStruct $struct, $currentVersionNo = 1)
71
    {
72
        try {
73
            return $this->innerGateway->insertContentObject($struct, $currentVersionNo);
74
        } catch (DBALException $e) {
75
            throw new RuntimeException('Database error', 0, $e);
76
        } catch (PDOException $e) {
77
            throw new RuntimeException('Database error', 0, $e);
78
        }
79
    }
80
81
    /**
82
     * Inserts a new version.
@@ 89-98 (lines=10) @@
86
     *
87
     * @return int ID
88
     */
89
    public function insertVersion(VersionInfo $versionInfo, array $fields)
90
    {
91
        try {
92
            return $this->innerGateway->insertVersion($versionInfo, $fields);
93
        } catch (DBALException $e) {
94
            throw new RuntimeException('Database error', 0, $e);
95
        } catch (PDOException $e) {
96
            throw new RuntimeException('Database error', 0, $e);
97
        }
98
    }
99
100
    /**
101
     * Updates an existing content identified by $contentId in respect to $struct.
@@ 125-134 (lines=10) @@
122
     * @param int $versionNo
123
     * @param \eZ\Publish\SPI\Persistence\Content\UpdateStruct $struct
124
     */
125
    public function updateVersion($contentId, $versionNo, UpdateStruct $struct)
126
    {
127
        try {
128
            return $this->innerGateway->updateVersion($contentId, $versionNo, $struct);
129
        } catch (DBALException $e) {
130
            throw new RuntimeException('Database error', 0, $e);
131
        } catch (PDOException $e) {
132
            throw new RuntimeException('Database error', 0, $e);
133
        }
134
    }
135
136
    /**
137
     * Updates "always available" flag for content identified by $contentId, in respect to $alwaysAvailable.
@@ 142-151 (lines=10) @@
139
     * @param int $contentId
140
     * @param bool $newAlwaysAvailable New "always available" value
141
     */
142
    public function updateAlwaysAvailableFlag($contentId, $newAlwaysAvailable)
143
    {
144
        try {
145
            return $this->innerGateway->updateAlwaysAvailableFlag($contentId, $newAlwaysAvailable);
146
        } catch (DBALException $e) {
147
            throw new RuntimeException('Database error', 0, $e);
148
        } catch (PDOException $e) {
149
            throw new RuntimeException('Database error', 0, $e);
150
        }
151
    }
152
153
    /**
154
     * Sets the state of object identified by $contentId and $version to $state.
@@ 164-173 (lines=10) @@
161
     *
162
     * @return bool
163
     */
164
    public function setStatus($contentId, $version, $status)
165
    {
166
        try {
167
            return $this->innerGateway->setStatus($contentId, $version, $status);
168
        } catch (DBALException $e) {
169
            throw new RuntimeException('Database error', 0, $e);
170
        } catch (PDOException $e) {
171
            throw new RuntimeException('Database error', 0, $e);
172
        }
173
    }
174
175
    /**
176
     * Inserts a new field.
@@ 260-269 (lines=10) @@
257
    /**
258
     * {@inheritdoc}
259
     */
260
    public function load($contentId, $version = null, array $translations = null)
261
    {
262
        try {
263
            return $this->innerGateway->load($contentId, $version, $translations);
264
        } catch (DBALException $e) {
265
            throw new RuntimeException('Database error', 0, $e);
266
        } catch (PDOException $e) {
267
            throw new RuntimeException('Database error', 0, $e);
268
        }
269
    }
270
271
    /**
272
     * {@inheritdoc}
@@ 274-283 (lines=10) @@
271
    /**
272
     * {@inheritdoc}
273
     */
274
    public function loadContentList(array $contentIds, array $translations = null)
275
    {
276
        try {
277
            return $this->innerGateway->loadContentList($contentIds, $translations);
278
        } catch (DBALException $e) {
279
            throw new RuntimeException('Database error', 0, $e);
280
        } catch (PDOException $e) {
281
            throw new RuntimeException('Database error', 0, $e);
282
        }
283
    }
284
285
    /**
286
     * Loads data for a content object identified by its remote ID.
@@ 294-303 (lines=10) @@
291
     *
292
     * @return array
293
     */
294
    public function loadContentInfoByRemoteId($remoteId)
295
    {
296
        try {
297
            return $this->innerGateway->loadContentInfoByRemoteId($remoteId);
298
        } catch (DBALException $e) {
299
            throw new \RuntimeException('Database error', 0, $e);
300
        } catch (\PDOException $e) {
301
            throw new \RuntimeException('Database error', 0, $e);
302
        }
303
    }
304
305
    /**
306
     * Loads info for a content object identified by its location ID (node ID).
@@ 316-325 (lines=10) @@
313
     *
314
     * @return array
315
     */
316
    public function loadContentInfoByLocationId($locationId)
317
    {
318
        try {
319
            return $this->innerGateway->loadContentInfoByLocationId($locationId);
320
        } catch (DBALException $e) {
321
            throw new \RuntimeException('Database error', 0, $e);
322
        } catch (\PDOException $e) {
323
            throw new \RuntimeException('Database error', 0, $e);
324
        }
325
    }
326
327
    /**
328
     * Loads info for content identified by $contentId.
@@ 339-348 (lines=10) @@
336
     *
337
     * @return array
338
     */
339
    public function loadContentInfo($contentId)
340
    {
341
        try {
342
            return $this->innerGateway->loadContentInfo($contentId);
343
        } catch (DBALException $e) {
344
            throw new RuntimeException('Database error', 0, $e);
345
        } catch (PDOException $e) {
346
            throw new RuntimeException('Database error', 0, $e);
347
        }
348
    }
349
350
    public function loadContentInfoList(array $contentIds)
351
    {
@@ 350-359 (lines=10) @@
347
        }
348
    }
349
350
    public function loadContentInfoList(array $contentIds)
351
    {
352
        try {
353
            return $this->innerGateway->loadContentInfoList($contentIds);
354
        } catch (DBALException $e) {
355
            throw new RuntimeException('Database error', 0, $e);
356
        } catch (PDOException $e) {
357
            throw new RuntimeException('Database error', 0, $e);
358
        }
359
    }
360
361
    /**
362
     * Loads version info for content identified by $contentId and $versionNo.
@@ 373-382 (lines=10) @@
370
     *
371
     * @return array
372
     */
373
    public function loadVersionInfo($contentId, $versionNo = null)
374
    {
375
        try {
376
            return $this->innerGateway->loadVersionInfo($contentId, $versionNo);
377
        } catch (DBALException $e) {
378
            throw new RuntimeException('Database error', 0, $e);
379
        } catch (PDOException $e) {
380
            throw new RuntimeException('Database error', 0, $e);
381
        }
382
    }
383
384
    /**
385
     * Returns data for all versions with given status created by the given $userId.
@@ 414-423 (lines=10) @@
411
     *
412
     * @return string[][]
413
     */
414
    public function listVersions($contentId, $status = null, $limit = -1)
415
    {
416
        try {
417
            return $this->innerGateway->listVersions($contentId, $status, $limit);
418
        } catch (DBALException $e) {
419
            throw new RuntimeException('Database error', 0, $e);
420
        } catch (PDOException $e) {
421
            throw new RuntimeException('Database error', 0, $e);
422
        }
423
    }
424
425
    /**
426
     * Returns all version numbers for the given $contentId.
@@ 432-441 (lines=10) @@
429
     *
430
     * @return int[]
431
     */
432
    public function listVersionNumbers($contentId)
433
    {
434
        try {
435
            return $this->innerGateway->listVersionNumbers($contentId);
436
        } catch (DBALException $e) {
437
            throw new RuntimeException('Database error', 0, $e);
438
        } catch (PDOException $e) {
439
            throw new RuntimeException('Database error', 0, $e);
440
        }
441
    }
442
443
    /**
444
     * Returns last version number for content identified by $contentId.
@@ 450-459 (lines=10) @@
447
     *
448
     * @return int
449
     */
450
    public function getLastVersionNumber($contentId)
451
    {
452
        try {
453
            return $this->innerGateway->getLastVersionNumber($contentId);
454
        } catch (DBALException $e) {
455
            throw new RuntimeException('Database error', 0, $e);
456
        } catch (PDOException $e) {
457
            throw new RuntimeException('Database error', 0, $e);
458
        }
459
    }
460
461
    /**
462
     * Returns all IDs for locations that refer to $contentId.
@@ 468-477 (lines=10) @@
465
     *
466
     * @return int[]
467
     */
468
    public function getAllLocationIds($contentId)
469
    {
470
        try {
471
            return $this->innerGateway->getAllLocationIds($contentId);
472
        } catch (DBALException $e) {
473
            throw new RuntimeException('Database error', 0, $e);
474
        } catch (PDOException $e) {
475
            throw new RuntimeException('Database error', 0, $e);
476
        }
477
    }
478
479
    /**
480
     * Returns all field IDs of $contentId grouped by their type.
@@ 490-499 (lines=10) @@
487
     *
488
     * @return int[][]
489
     */
490
    public function getFieldIdsByType($contentId, $versionNo = null, $languageCode = null)
491
    {
492
        try {
493
            return $this->innerGateway->getFieldIdsByType($contentId, $versionNo, $languageCode);
494
        } catch (DBALException $e) {
495
            throw new RuntimeException('Database error', 0, $e);
496
        } catch (PDOException $e) {
497
            throw new RuntimeException('Database error', 0, $e);
498
        }
499
    }
500
501
    /**
502
     * Deletes relations to and from $contentId.
@@ 508-517 (lines=10) @@
505
     * @param int $contentId
506
     * @param int|null $versionNo
507
     */
508
    public function deleteRelations($contentId, $versionNo = null)
509
    {
510
        try {
511
            return $this->innerGateway->deleteRelations($contentId, $versionNo);
512
        } catch (DBALException $e) {
513
            throw new RuntimeException('Database error', 0, $e);
514
        } catch (PDOException $e) {
515
            throw new RuntimeException('Database error', 0, $e);
516
        }
517
    }
518
519
    /**
520
     * Removes relations to Content with $contentId from Relation and RelationList field type fields.
@@ 524-533 (lines=10) @@
521
     *
522
     * @param int $contentId
523
     */
524
    public function removeReverseFieldRelations($contentId)
525
    {
526
        try {
527
            return $this->innerGateway->removeReverseFieldRelations($contentId);
528
        } catch (DBALException $e) {
529
            throw new RuntimeException('Database error', 0, $e);
530
        } catch (PDOException $e) {
531
            throw new RuntimeException('Database error', 0, $e);
532
        }
533
    }
534
535
    /**
536
     * Deletes the field with the given $fieldId.
@@ 540-549 (lines=10) @@
537
     *
538
     * @param int $fieldId
539
     */
540
    public function deleteField($fieldId)
541
    {
542
        try {
543
            return $this->innerGateway->deleteField($fieldId);
544
        } catch (DBALException $e) {
545
            throw new RuntimeException('Database error', 0, $e);
546
        } catch (PDOException $e) {
547
            throw new RuntimeException('Database error', 0, $e);
548
        }
549
    }
550
551
    /**
552
     * Deletes all fields of $contentId in all versions.
@@ 558-567 (lines=10) @@
555
     * @param int $contentId
556
     * @param int|null $versionNo
557
     */
558
    public function deleteFields($contentId, $versionNo = null)
559
    {
560
        try {
561
            return $this->innerGateway->deleteFields($contentId, $versionNo);
562
        } catch (DBALException $e) {
563
            throw new RuntimeException('Database error', 0, $e);
564
        } catch (PDOException $e) {
565
            throw new RuntimeException('Database error', 0, $e);
566
        }
567
    }
568
569
    /**
570
     * Deletes all versions of $contentId.
@@ 576-585 (lines=10) @@
573
     * @param int $contentId
574
     * @param int|null $versionNo
575
     */
576
    public function deleteVersions($contentId, $versionNo = null)
577
    {
578
        try {
579
            return $this->innerGateway->deleteVersions($contentId, $versionNo);
580
        } catch (DBALException $e) {
581
            throw new RuntimeException('Database error', 0, $e);
582
        } catch (PDOException $e) {
583
            throw new RuntimeException('Database error', 0, $e);
584
        }
585
    }
586
587
    /**
588
     * Deletes all names of $contentId.
@@ 594-603 (lines=10) @@
591
     * @param int $contentId
592
     * @param int|null $versionNo
593
     */
594
    public function deleteNames($contentId, $versionNo = null)
595
    {
596
        try {
597
            return $this->innerGateway->deleteNames($contentId, $versionNo);
598
        } catch (DBALException $e) {
599
            throw new RuntimeException('Database error', 0, $e);
600
        } catch (PDOException $e) {
601
            throw new RuntimeException('Database error', 0, $e);
602
        }
603
    }
604
605
    /**
606
     * Sets the content object name.
@@ 613-622 (lines=10) @@
610
     * @param string $name
611
     * @param string $language
612
     */
613
    public function setName($contentId, $version, $name, $language)
614
    {
615
        try {
616
            return $this->innerGateway->setName($contentId, $version, $name, $language);
617
        } catch (DBALException $e) {
618
            throw new RuntimeException('Database error', 0, $e);
619
        } catch (PDOException $e) {
620
            throw new RuntimeException('Database error', 0, $e);
621
        }
622
    }
623
624
    /**
625
     * Deletes the actual content object referred to by $contentId.
@@ 629-638 (lines=10) @@
626
     *
627
     * @param int $contentId
628
     */
629
    public function deleteContent($contentId)
630
    {
631
        try {
632
            return $this->innerGateway->deleteContent($contentId);
633
        } catch (DBALException $e) {
634
            throw new RuntimeException('Database error', 0, $e);
635
        } catch (PDOException $e) {
636
            throw new RuntimeException('Database error', 0, $e);
637
        }
638
    }
639
640
    /**
641
     * Loads data of related to/from $contentId.
@@ 649-658 (lines=10) @@
646
     *
647
     * @return mixed[][] Content data, array structured like {@see \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()}
648
     */
649
    public function loadRelations($contentId, $contentVersionNo = null, $relationType = null)
650
    {
651
        try {
652
            return $this->innerGateway->loadRelations($contentId, $contentVersionNo, $relationType);
653
        } catch (DBALException $e) {
654
            throw new RuntimeException('Database error', 0, $e);
655
        } catch (PDOException $e) {
656
            throw new RuntimeException('Database error', 0, $e);
657
        }
658
    }
659
660
    /**
661
     * Loads data of related to/from $contentId.
@@ 668-677 (lines=10) @@
665
     *
666
     * @return mixed[][] Content data, array structured like {@see \eZ\Publish\Core\Persistence\Legacy\Content\Gateway::load()}
667
     */
668
    public function loadReverseRelations($contentId, $relationType = null)
669
    {
670
        try {
671
            return $this->innerGateway->loadReverseRelations($contentId, $relationType);
672
        } catch (DBALException $e) {
673
            throw new RuntimeException('Database error', 0, $e);
674
        } catch (PDOException $e) {
675
            throw new RuntimeException('Database error', 0, $e);
676
        }
677
    }
678
679
    /**
680
     * Deletes the relation with the given $relationId.
@@ 688-697 (lines=10) @@
685
     *                 \eZ\Publish\API\Repository\Values\Content\Relation::LINK,
686
     *                 \eZ\Publish\API\Repository\Values\Content\Relation::FIELD}
687
     */
688
    public function deleteRelation($relationId, $type)
689
    {
690
        try {
691
            return $this->innerGateway->deleteRelation($relationId, $type);
692
        } catch (DBALException $e) {
693
            throw new RuntimeException('Database error', 0, $e);
694
        } catch (PDOException $e) {
695
            throw new RuntimeException('Database error', 0, $e);
696
        }
697
    }
698
699
    /**
700
     * Inserts a new relation database record.
@@ 706-715 (lines=10) @@
703
     *
704
     * @return int ID the inserted ID
705
     */
706
    public function insertRelation(RelationCreateStruct $struct)
707
    {
708
        try {
709
            return $this->innerGateway->insertRelation($struct);
710
        } catch (DBALException $e) {
711
            throw new RuntimeException('Database error', 0, $e);
712
        } catch (PDOException $e) {
713
            throw new RuntimeException('Database error', 0, $e);
714
        }
715
    }
716
717
    /**
718
     * Returns all Content IDs for a given $contentTypeId.
@@ 724-733 (lines=10) @@
721
     *
722
     * @return int[]
723
     */
724
    public function getContentIdsByContentTypeId($contentTypeId)
725
    {
726
        try {
727
            return $this->innerGateway->getContentIdsByContentTypeId($contentTypeId);
728
        } catch (DBALException $e) {
729
            throw new RuntimeException('Database error', 0, $e);
730
        } catch (PDOException $e) {
731
            throw new RuntimeException('Database error', 0, $e);
732
        }
733
    }
734
735
    /**
736
     * Load name data for set of content id's and corresponding version number.
@@ 742-751 (lines=10) @@
739
     *
740
     * @return array
741
     */
742
    public function loadVersionedNameData($rows)
743
    {
744
        try {
745
            return $this->innerGateway->loadVersionedNameData($rows);
746
        } catch (DBALException $e) {
747
            throw new RuntimeException('Database error', 0, $e);
748
        } catch (PDOException $e) {
749
            throw new RuntimeException('Database error', 0, $e);
750
        }
751
    }
752
753
    /**
754
     * Batch method for copying all relation meta data for copied Content object.
@@ 762-771 (lines=10) @@
759
     * @param int $copiedContentId
760
     * @param int|null $versionNo If specified only copy for a given version number, otherwise all.
761
     */
762
    public function copyRelations($originalContentId, $copiedContentId, $versionNo = null)
763
    {
764
        try {
765
            return $this->innerGateway->copyRelations($originalContentId, $copiedContentId, $versionNo);
766
        } catch (DBALException $e) {
767
            throw new RuntimeException('Database error', 0, $e);
768
        } catch (PDOException $e) {
769
            throw new RuntimeException('Database error', 0, $e);
770
        }
771
    }
772
773
    /**
774
     * Remove the specified translation from all the Versions of a Content Object.
@@ 779-788 (lines=10) @@
776
     * @param int $contentId
777
     * @param string $languageCode language code of the translation
778
     */
779
    public function deleteTranslationFromContent($contentId, $languageCode)
780
    {
781
        try {
782
            return $this->innerGateway->deleteTranslationFromContent($contentId, $languageCode);
783
        } catch (DBALException $e) {
784
            throw new RuntimeException('Database error', 0, $e);
785
        } catch (PDOException $e) {
786
            throw new RuntimeException('Database error', 0, $e);
787
        }
788
    }
789
790
    /**
791
     * Delete Content fields (attributes) for the given Translation.
@@ 798-807 (lines=10) @@
795
     * @param int $contentId
796
     * @param int $versionNo (optional) filter by versionNo
797
     */
798
    public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
799
    {
800
        try {
801
            return $this->innerGateway->deleteTranslatedFields($languageCode, $contentId, $versionNo);
802
        } catch (DBALException $e) {
803
            throw new RuntimeException('Database error', 0, $e);
804
        } catch (PDOException $e) {
805
            throw new RuntimeException('Database error', 0, $e);
806
        }
807
    }
808
809
    /**
810
     * Delete the specified Translation from the given Version.
@@ 816-825 (lines=10) @@
813
     * @param int $versionNo
814
     * @param string $languageCode
815
     */
816
    public function deleteTranslationFromVersion($contentId, $versionNo, $languageCode)
817
    {
818
        try {
819
            return $this->innerGateway->deleteTranslationFromVersion($contentId, $versionNo, $languageCode);
820
        } catch (DBALException $e) {
821
            throw new RuntimeException('Database error', 0, $e);
822
        } catch (PDOException $e) {
823
            throw new RuntimeException('Database error', 0, $e);
824
        }
825
    }
826
}
827

eZ/Publish/Core/Persistence/Legacy/Content/Language/Gateway/ExceptionConversion.php 7 locations

@@ 46-55 (lines=10) @@
43
     *
44
     * @return int ID of the new language
45
     */
46
    public function insertLanguage(Language $language)
47
    {
48
        try {
49
            return $this->innerGateway->insertLanguage($language);
50
        } catch (DBALException $e) {
51
            throw new RuntimeException('Database error', 0, $e);
52
        } catch (PDOException $e) {
53
            throw new RuntimeException('Database error', 0, $e);
54
        }
55
    }
56
57
    /**
58
     * Updates the data of the given $language.
@@ 62-71 (lines=10) @@
59
     *
60
     * @param Language $language
61
     */
62
    public function updateLanguage(Language $language)
63
    {
64
        try {
65
            return $this->innerGateway->updateLanguage($language);
66
        } catch (DBALException $e) {
67
            throw new RuntimeException('Database error', 0, $e);
68
        } catch (PDOException $e) {
69
            throw new RuntimeException('Database error', 0, $e);
70
        }
71
    }
72
73
    /**
74
     * Loads data for the Language with $id.
@@ 80-89 (lines=10) @@
77
     *
78
     * @return string[][]
79
     */
80
    public function loadLanguageData($id)
81
    {
82
        try {
83
            return $this->innerGateway->loadLanguageData($id);
84
        } catch (DBALException $e) {
85
            throw new RuntimeException('Database error', 0, $e);
86
        } catch (PDOException $e) {
87
            throw new RuntimeException('Database error', 0, $e);
88
        }
89
    }
90
91
    /**
92
     * Loads data for the Language with Language Code (eg: eng-GB).
@@ 98-107 (lines=10) @@
95
     *
96
     * @return string[][]
97
     */
98
    public function loadLanguageDataByLanguageCode($languageCode)
99
    {
100
        try {
101
            return $this->innerGateway->loadLanguageDataByLanguageCode($languageCode);
102
        } catch (DBALException $e) {
103
            throw new RuntimeException('Database error', 0, $e);
104
        } catch (PDOException $e) {
105
            throw new RuntimeException('Database error', 0, $e);
106
        }
107
    }
108
109
    /**
110
     * Loads the data for all languages.
@@ 114-123 (lines=10) @@
111
     *
112
     * @return string[][]
113
     */
114
    public function loadAllLanguagesData()
115
    {
116
        try {
117
            return $this->innerGateway->loadAllLanguagesData();
118
        } catch (DBALException $e) {
119
            throw new RuntimeException('Database error', 0, $e);
120
        } catch (PDOException $e) {
121
            throw new RuntimeException('Database error', 0, $e);
122
        }
123
    }
124
125
    /**
126
     * Deletes the language with $id.
@@ 130-139 (lines=10) @@
127
     *
128
     * @param int $id
129
     */
130
    public function deleteLanguage($id)
131
    {
132
        try {
133
            return $this->innerGateway->deleteLanguage($id);
134
        } catch (DBALException $e) {
135
            throw new RuntimeException('Database error', 0, $e);
136
        } catch (PDOException $e) {
137
            throw new RuntimeException('Database error', 0, $e);
138
        }
139
    }
140
141
    /**
142
     * Check whether a language may be deleted.
@@ 148-157 (lines=10) @@
145
     *
146
     * @return bool
147
     */
148
    public function canDeleteLanguage($id)
149
    {
150
        try {
151
            return $this->innerGateway->canDeleteLanguage($id);
152
        } catch (DBALException $e) {
153
            throw new RuntimeException('Database error', 0, $e);
154
        } catch (PDOException $e) {
155
            throw new RuntimeException('Database error', 0, $e);
156
        }
157
    }
158
}
159

eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/ExceptionConversion.php 30 locations

@@ 54-63 (lines=10) @@
51
     *
52
     * @return array
53
     */
54
    public function getBasicNodeData($nodeId)
55
    {
56
        try {
57
            return $this->innerGateway->getBasicNodeData($nodeId);
58
        } catch (DBALException $e) {
59
            throw new RuntimeException('Database error', 0, $e);
60
        } catch (PDOException $e) {
61
            throw new RuntimeException('Database error', 0, $e);
62
        }
63
    }
64
65
    /**
66
     * Returns an array with basic node data for the node with $remoteId.
@@ 74-83 (lines=10) @@
71
     *
72
     * @return array
73
     */
74
    public function getBasicNodeDataByRemoteId($remoteId)
75
    {
76
        try {
77
            return $this->innerGateway->getBasicNodeDataByRemoteId($remoteId);
78
        } catch (DBALException $e) {
79
            throw new RuntimeException('Database error', 0, $e);
80
        } catch (PDOException $e) {
81
            throw new RuntimeException('Database error', 0, $e);
82
        }
83
    }
84
85
    /**
86
     * Returns total count and data for all Locations satisfying the parameters.
@@ 115-124 (lines=10) @@
112
     *
113
     * @return array
114
     */
115
    public function loadLocationDataByContent($contentId, $rootLocationId = null)
116
    {
117
        try {
118
            return $this->innerGateway->loadLocationDataByContent($contentId, $rootLocationId);
119
        } catch (DBALException $e) {
120
            throw new RuntimeException('Database error', 0, $e);
121
        } catch (PDOException $e) {
122
            throw new RuntimeException('Database error', 0, $e);
123
        }
124
    }
125
126
    /**
127
     * @see \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway::loadParentLocationsDataForDraftContent
@@ 129-138 (lines=10) @@
126
    /**
127
     * @see \eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway::loadParentLocationsDataForDraftContent
128
     */
129
    public function loadParentLocationsDataForDraftContent($contentId)
130
    {
131
        try {
132
            return $this->innerGateway->loadParentLocationsDataForDraftContent($contentId);
133
        } catch (DBALException $e) {
134
            throw new RuntimeException('Database error', 0, $e);
135
        } catch (PDOException $e) {
136
            throw new RuntimeException('Database error', 0, $e);
137
        }
138
    }
139
140
    /**
141
     * Find all content in the given subtree.
@@ 148-157 (lines=10) @@
145
     *
146
     * @return array
147
     */
148
    public function getSubtreeContent($sourceId, $onlyIds = false)
149
    {
150
        try {
151
            return $this->innerGateway->getSubtreeContent($sourceId, $onlyIds);
152
        } catch (DBALException $e) {
153
            throw new RuntimeException('Database error', 0, $e);
154
        } catch (PDOException $e) {
155
            throw new RuntimeException('Database error', 0, $e);
156
        }
157
    }
158
159
    /**
160
     * Returns data for the first level children of the location identified by given $locationId.
@@ 166-175 (lines=10) @@
163
     *
164
     * @return array
165
     */
166
    public function getChildren($locationId)
167
    {
168
        try {
169
            return $this->innerGateway->getChildren($locationId);
170
        } catch (DBALException $e) {
171
            throw new RuntimeException('Database error', 0, $e);
172
        } catch (PDOException $e) {
173
            throw new RuntimeException('Database error', 0, $e);
174
        }
175
    }
176
177
    /**
178
     * Update path strings to move nodes in the ezcontentobject_tree table.
@@ 188-197 (lines=10) @@
185
     * @param array $fromPathString
186
     * @param array $toPathString
187
     */
188
    public function moveSubtreeNodes(array $fromPathString, array $toPathString)
189
    {
190
        try {
191
            return $this->innerGateway->moveSubtreeNodes($fromPathString, $toPathString);
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
     * Updated subtree modification time for all nodes on path.
@@ 205-214 (lines=10) @@
202
     * @param string $pathString
203
     * @param int|null $timestamp
204
     */
205
    public function updateSubtreeModificationTime($pathString, $timestamp = null)
206
    {
207
        try {
208
            return $this->innerGateway->updateSubtreeModificationTime($pathString, $timestamp);
209
        } catch (DBALException $e) {
210
            throw new RuntimeException('Database error', 0, $e);
211
        } catch (PDOException $e) {
212
            throw new RuntimeException('Database error', 0, $e);
213
        }
214
    }
215
216
    /**
217
     * Update node assignment table.
@@ 243-252 (lines=10) @@
240
     * @param mixed $contentId
241
     * @param mixed $versionNo
242
     */
243
    public function createLocationsFromNodeAssignments($contentId, $versionNo)
244
    {
245
        try {
246
            return $this->innerGateway->createLocationsFromNodeAssignments($contentId, $versionNo);
247
        } catch (DBALException $e) {
248
            throw new RuntimeException('Database error', 0, $e);
249
        } catch (PDOException $e) {
250
            throw new RuntimeException('Database error', 0, $e);
251
        }
252
    }
253
254
    /**
255
     * Updates all Locations of content identified with $contentId with $versionNo.
@@ 260-269 (lines=10) @@
257
     * @param mixed $contentId
258
     * @param mixed $versionNo
259
     */
260
    public function updateLocationsContentVersionNo($contentId, $versionNo)
261
    {
262
        try {
263
            return $this->innerGateway->updateLocationsContentVersionNo($contentId, $versionNo);
264
        } catch (DBALException $e) {
265
            throw new RuntimeException('Database error', 0, $e);
266
        } catch (PDOException $e) {
267
            throw new RuntimeException('Database error', 0, $e);
268
        }
269
    }
270
271
    /**
272
     * Sets a location to be hidden, and it self + all children to invisible.
@@ 276-285 (lines=10) @@
273
     *
274
     * @param string $pathString
275
     */
276
    public function hideSubtree($pathString)
277
    {
278
        try {
279
            return $this->innerGateway->hideSubtree($pathString);
280
        } catch (DBALException $e) {
281
            throw new RuntimeException('Database error', 0, $e);
282
        } catch (PDOException $e) {
283
            throw new RuntimeException('Database error', 0, $e);
284
        }
285
    }
286
287
    /**
288
     * Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree.
@@ 293-302 (lines=10) @@
290
     *
291
     * @param string $pathString
292
     */
293
    public function unHideSubtree($pathString)
294
    {
295
        try {
296
            return $this->innerGateway->unHideSubtree($pathString);
297
        } catch (DBALException $e) {
298
            throw new RuntimeException('Database error', 0, $e);
299
        } catch (PDOException $e) {
300
            throw new RuntimeException('Database error', 0, $e);
301
        }
302
    }
303
304
    /**
305
     * Swaps the content object being pointed to by a location object.
@@ 315-324 (lines=10) @@
312
     *
313
     * @return bool
314
     */
315
    public function swap($locationId1, $locationId2)
316
    {
317
        try {
318
            return $this->innerGateway->swap($locationId1, $locationId2);
319
        } catch (DBALException $e) {
320
            throw new RuntimeException('Database error', 0, $e);
321
        } catch (PDOException $e) {
322
            throw new RuntimeException('Database error', 0, $e);
323
        }
324
    }
325
326
    /**
327
     * Creates a new location in given $parentNode.
@@ 334-343 (lines=10) @@
331
     *
332
     * @return \eZ\Publish\SPI\Persistence\Content\Location
333
     */
334
    public function create(CreateStruct $createStruct, array $parentNode)
335
    {
336
        try {
337
            return $this->innerGateway->create($createStruct, $parentNode);
338
        } catch (DBALException $e) {
339
            throw new RuntimeException('Database error', 0, $e);
340
        } catch (PDOException $e) {
341
            throw new RuntimeException('Database error', 0, $e);
342
        }
343
    }
344
345
    /**
346
     * Create an entry in the node assignment table.
@@ 352-361 (lines=10) @@
349
     * @param mixed $parentNodeId
350
     * @param int $type
351
     */
352
    public function createNodeAssignment(CreateStruct $createStruct, $parentNodeId, $type = self::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP)
353
    {
354
        try {
355
            return $this->innerGateway->createNodeAssignment($createStruct, $parentNodeId, $type);
356
        } catch (DBALException $e) {
357
            throw new RuntimeException('Database error', 0, $e);
358
        } catch (PDOException $e) {
359
            throw new RuntimeException('Database error', 0, $e);
360
        }
361
    }
362
363
    /**
364
     * Deletes node assignment for given $contentId and $versionNo.
@@ 369-378 (lines=10) @@
366
     * @param int $contentId
367
     * @param int $versionNo
368
     */
369
    public function deleteNodeAssignment($contentId, $versionNo = null)
370
    {
371
        try {
372
            return $this->innerGateway->deleteNodeAssignment($contentId, $versionNo);
373
        } catch (DBALException $e) {
374
            throw new RuntimeException('Database error', 0, $e);
375
        } catch (PDOException $e) {
376
            throw new RuntimeException('Database error', 0, $e);
377
        }
378
    }
379
380
    /**
381
     * Updates an existing location.
@@ 388-397 (lines=10) @@
385
     * @param \eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct $location
386
     * @param int $locationId
387
     */
388
    public function update(UpdateStruct $location, $locationId)
389
    {
390
        try {
391
            return $this->innerGateway->update($location, $locationId);
392
        } catch (DBALException $e) {
393
            throw new RuntimeException('Database error', 0, $e);
394
        } catch (PDOException $e) {
395
            throw new RuntimeException('Database error', 0, $e);
396
        }
397
    }
398
399
    /**
400
     * Updates path identification string for given $locationId.
@@ 406-415 (lines=10) @@
403
     * @param mixed $parentLocationId
404
     * @param string $text
405
     */
406
    public function updatePathIdentificationString($locationId, $parentLocationId, $text)
407
    {
408
        try {
409
            return $this->innerGateway->updatePathIdentificationString($locationId, $parentLocationId, $text);
410
        } catch (DBALException $e) {
411
            throw new RuntimeException('Database error', 0, $e);
412
        } catch (PDOException $e) {
413
            throw new RuntimeException('Database error', 0, $e);
414
        }
415
    }
416
417
    /**
418
     * Deletes ezcontentobject_tree row for given $locationId (node_id).
@@ 422-431 (lines=10) @@
419
     *
420
     * @param mixed $locationId
421
     */
422
    public function removeLocation($locationId)
423
    {
424
        try {
425
            return $this->innerGateway->removeLocation($locationId);
426
        } catch (DBALException $e) {
427
            throw new RuntimeException('Database error', 0, $e);
428
        } catch (PDOException $e) {
429
            throw new RuntimeException('Database error', 0, $e);
430
        }
431
    }
432
433
    /**
434
     * Returns id of the next in line node to be set as a new main node.
@@ 445-454 (lines=10) @@
442
     *
443
     * @return array
444
     */
445
    public function getFallbackMainNodeData($contentId, $locationId)
446
    {
447
        try {
448
            return $this->innerGateway->getFallbackMainNodeData($contentId, $locationId);
449
        } catch (DBALException $e) {
450
            throw new RuntimeException('Database error', 0, $e);
451
        } catch (PDOException $e) {
452
            throw new RuntimeException('Database error', 0, $e);
453
        }
454
    }
455
456
    /**
457
     * Sends a single location identified by given $locationId to the trash.
@@ 465-474 (lines=10) @@
462
     *
463
     * @return bool
464
     */
465
    public function trashLocation($locationId)
466
    {
467
        try {
468
            return $this->innerGateway->trashLocation($locationId);
469
        } catch (DBALException $e) {
470
            throw new RuntimeException('Database error', 0, $e);
471
        } catch (PDOException $e) {
472
            throw new RuntimeException('Database error', 0, $e);
473
        }
474
    }
475
476
    /**
477
     * Returns a trashed location to normal state.
@@ 489-498 (lines=10) @@
486
     *
487
     * @return \eZ\Publish\SPI\Persistence\Content\Location
488
     */
489
    public function untrashLocation($locationId, $newParentId = null)
490
    {
491
        try {
492
            return $this->innerGateway->untrashLocation($locationId, $newParentId);
493
        } catch (DBALException $e) {
494
            throw new RuntimeException('Database error', 0, $e);
495
        } catch (PDOException $e) {
496
            throw new RuntimeException('Database error', 0, $e);
497
        }
498
    }
499
500
    /**
501
     * Loads trash data specified by location ID.
@@ 507-516 (lines=10) @@
504
     *
505
     * @return array
506
     */
507
    public function loadTrashByLocation($locationId)
508
    {
509
        try {
510
            return $this->innerGateway->loadTrashByLocation($locationId);
511
        } catch (DBALException $e) {
512
            throw new RuntimeException('Database error', 0, $e);
513
        } catch (PDOException $e) {
514
            throw new RuntimeException('Database error', 0, $e);
515
        }
516
    }
517
518
    /**
519
     * Removes every entries in the trash.
@@ 524-533 (lines=10) @@
521
     *
522
     * Basically truncates ezcontentobject_trash table.
523
     */
524
    public function cleanupTrash()
525
    {
526
        try {
527
            return $this->innerGateway->cleanupTrash();
528
        } catch (DBALException $e) {
529
            throw new RuntimeException('Database error', 0, $e);
530
        } catch (PDOException $e) {
531
            throw new RuntimeException('Database error', 0, $e);
532
        }
533
    }
534
535
    /**
536
     * Lists trashed items.
@@ 562-571 (lines=10) @@
559
     *
560
     * @param int $id The trashed location Id
561
     */
562
    public function removeElementFromTrash($id)
563
    {
564
        try {
565
            return $this->innerGateway->removeElementFromTrash($id);
566
        } catch (DBALException $e) {
567
            throw new RuntimeException('Database error', 0, $e);
568
        } catch (PDOException $e) {
569
            throw new RuntimeException('Database error', 0, $e);
570
        }
571
    }
572
573
    /**
574
     * Set section on all content objects in the subtree.
@@ 581-590 (lines=10) @@
578
     *
579
     * @return bool
580
     */
581
    public function setSectionForSubtree($pathString, $sectionId)
582
    {
583
        try {
584
            return $this->innerGateway->setSectionForSubtree($pathString, $sectionId);
585
        } catch (DBALException $e) {
586
            throw new RuntimeException('Database error', 0, $e);
587
        } catch (PDOException $e) {
588
            throw new RuntimeException('Database error', 0, $e);
589
        }
590
    }
591
592
    /**
593
     * Returns how many locations given content object identified by $contentId has.
@@ 599-608 (lines=10) @@
596
     *
597
     * @return int
598
     */
599
    public function countLocationsByContentId($contentId)
600
    {
601
        try {
602
            return $this->innerGateway->countLocationsByContentId($contentId);
603
        } catch (DBALException $e) {
604
            throw new RuntimeException('Database error', 0, $e);
605
        } catch (PDOException $e) {
606
            throw new RuntimeException('Database error', 0, $e);
607
        }
608
    }
609
610
    /**
611
     * Changes main location of content identified by given $contentId to location identified by given $locationId.
@@ 622-631 (lines=10) @@
619
     * @param mixed $parentLocationId parent location of location identified by $locationId, needed to update
620
     *        eznode_assignment table
621
     */
622
    public function changeMainLocation($contentId, $locationId, $versionNo, $parentLocationId)
623
    {
624
        try {
625
            return $this->innerGateway->changeMainLocation($contentId, $locationId, $versionNo, $parentLocationId);
626
        } catch (DBALException $e) {
627
            throw new RuntimeException('Database error', 0, $e);
628
        } catch (PDOException $e) {
629
            throw new RuntimeException('Database error', 0, $e);
630
        }
631
    }
632
633
    /**
634
     * Get the total number of all Locations, except the Root node.
@@ 640-649 (lines=10) @@
637
     *
638
     * @return int
639
     */
640
    public function countAllLocations()
641
    {
642
        try {
643
            return $this->innerGateway->countAllLocations();
644
        } catch (DBALException $e) {
645
            throw new RuntimeException('Database error', 0, $e);
646
        } catch (PDOException $e) {
647
            throw new RuntimeException('Database error', 0, $e);
648
        }
649
    }
650
651
    /**
652
     * Load data of every Location, except the Root node.
@@ 659-668 (lines=10) @@
656
     *
657
     * @return array
658
     */
659
    public function loadAllLocationsData($offset, $limit)
660
    {
661
        try {
662
            return $this->innerGateway->loadAllLocationsData($offset, $limit);
663
        } catch (DBALException $e) {
664
            throw new RuntimeException('Database error', 0, $e);
665
        } catch (PDOException $e) {
666
            throw new RuntimeException('Database error', 0, $e);
667
        }
668
    }
669
}
670

eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Gateway/ExceptionConversion.php 18 locations

@@ 47-56 (lines=10) @@
44
     *
45
     * @return array
46
     */
47
    public function loadObjectStateData($stateId)
48
    {
49
        try {
50
            return $this->innerGateway->loadObjectStateData($stateId);
51
        } catch (DBALException $e) {
52
            throw new RuntimeException('Database error', 0, $e);
53
        } catch (PDOException $e) {
54
            throw new RuntimeException('Database error', 0, $e);
55
        }
56
    }
57
58
    /**
59
     * Loads data for an object state by identifier.
@@ 66-75 (lines=10) @@
63
     *
64
     * @return array
65
     */
66
    public function loadObjectStateDataByIdentifier($identifier, $groupId)
67
    {
68
        try {
69
            return $this->innerGateway->loadObjectStateDataByIdentifier($identifier, $groupId);
70
        } catch (DBALException $e) {
71
            throw new RuntimeException('Database error', 0, $e);
72
        } catch (PDOException $e) {
73
            throw new RuntimeException('Database error', 0, $e);
74
        }
75
    }
76
77
    /**
78
     * Loads data for all object states belonging to group with $groupId ID.
@@ 84-93 (lines=10) @@
81
     *
82
     * @return array
83
     */
84
    public function loadObjectStateListData($groupId)
85
    {
86
        try {
87
            return $this->innerGateway->loadObjectStateListData($groupId);
88
        } catch (DBALException $e) {
89
            throw new RuntimeException('Database error', 0, $e);
90
        } catch (PDOException $e) {
91
            throw new RuntimeException('Database error', 0, $e);
92
        }
93
    }
94
95
    /**
96
     * Loads data for an object state group.
@@ 102-111 (lines=10) @@
99
     *
100
     * @return array
101
     */
102
    public function loadObjectStateGroupData($groupId)
103
    {
104
        try {
105
            return $this->innerGateway->loadObjectStateGroupData($groupId);
106
        } catch (DBALException $e) {
107
            throw new RuntimeException('Database error', 0, $e);
108
        } catch (PDOException $e) {
109
            throw new RuntimeException('Database error', 0, $e);
110
        }
111
    }
112
113
    /**
114
     * Loads data for an object state group by identifier.
@@ 120-129 (lines=10) @@
117
     *
118
     * @return array
119
     */
120
    public function loadObjectStateGroupDataByIdentifier($identifier)
121
    {
122
        try {
123
            return $this->innerGateway->loadObjectStateGroupDataByIdentifier($identifier);
124
        } catch (DBALException $e) {
125
            throw new RuntimeException('Database error', 0, $e);
126
        } catch (PDOException $e) {
127
            throw new RuntimeException('Database error', 0, $e);
128
        }
129
    }
130
131
    /**
132
     * Loads data for all object state groups, filtered by $offset and $limit.
@@ 139-148 (lines=10) @@
136
     *
137
     * @return array
138
     */
139
    public function loadObjectStateGroupListData($offset, $limit)
140
    {
141
        try {
142
            return $this->innerGateway->loadObjectStateGroupListData($offset, $limit);
143
        } catch (DBALException $e) {
144
            throw new RuntimeException('Database error', 0, $e);
145
        } catch (PDOException $e) {
146
            throw new RuntimeException('Database error', 0, $e);
147
        }
148
    }
149
150
    /**
151
     * Inserts a new object state into database.
@@ 156-165 (lines=10) @@
153
     * @param \eZ\Publish\SPI\Persistence\Content\ObjectState $objectState
154
     * @param int $groupId
155
     */
156
    public function insertObjectState(ObjectState $objectState, $groupId)
157
    {
158
        try {
159
            return $this->innerGateway->insertObjectState($objectState, $groupId);
160
        } catch (DBALException $e) {
161
            throw new RuntimeException('Database error', 0, $e);
162
        } catch (PDOException $e) {
163
            throw new RuntimeException('Database error', 0, $e);
164
        }
165
    }
166
167
    /**
168
     * Updates the stored object state with provided data.
@@ 172-181 (lines=10) @@
169
     *
170
     * @param \eZ\Publish\SPI\Persistence\Content\ObjectState $objectState
171
     */
172
    public function updateObjectState(ObjectState $objectState)
173
    {
174
        try {
175
            return $this->innerGateway->updateObjectState($objectState);
176
        } catch (DBALException $e) {
177
            throw new RuntimeException('Database error', 0, $e);
178
        } catch (PDOException $e) {
179
            throw new RuntimeException('Database error', 0, $e);
180
        }
181
    }
182
183
    /**
184
     * Deletes object state identified by $stateId.
@@ 188-197 (lines=10) @@
185
     *
186
     * @param int $stateId
187
     */
188
    public function deleteObjectState($stateId)
189
    {
190
        try {
191
            return $this->innerGateway->deleteObjectState($stateId);
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
     * Update object state links from $oldStateId to $newStateId.
@@ 205-214 (lines=10) @@
202
     * @param int $oldStateId
203
     * @param int $newStateId
204
     */
205
    public function updateObjectStateLinks($oldStateId, $newStateId)
206
    {
207
        try {
208
            return $this->innerGateway->updateObjectStateLinks($oldStateId, $newStateId);
209
        } catch (DBALException $e) {
210
            throw new RuntimeException('Database error', 0, $e);
211
        } catch (PDOException $e) {
212
            throw new RuntimeException('Database error', 0, $e);
213
        }
214
    }
215
216
    /**
217
     * Deletes object state links identified by $stateId.
@@ 221-230 (lines=10) @@
218
     *
219
     * @param int $stateId
220
     */
221
    public function deleteObjectStateLinks($stateId)
222
    {
223
        try {
224
            return $this->innerGateway->deleteObjectStateLinks($stateId);
225
        } catch (DBALException $e) {
226
            throw new RuntimeException('Database error', 0, $e);
227
        } catch (PDOException $e) {
228
            throw new RuntimeException('Database error', 0, $e);
229
        }
230
    }
231
232
    /**
233
     * Inserts a new object state group into database.
@@ 237-246 (lines=10) @@
234
     *
235
     * @param \eZ\Publish\SPI\Persistence\Content\ObjectState\Group $objectStateGroup
236
     */
237
    public function insertObjectStateGroup(Group $objectStateGroup)
238
    {
239
        try {
240
            return $this->innerGateway->insertObjectStateGroup($objectStateGroup);
241
        } catch (DBALException $e) {
242
            throw new RuntimeException('Database error', 0, $e);
243
        } catch (PDOException $e) {
244
            throw new RuntimeException('Database error', 0, $e);
245
        }
246
    }
247
248
    /**
249
     * Updates the stored object state group with provided data.
@@ 253-262 (lines=10) @@
250
     *
251
     * @param \eZ\Publish\SPI\Persistence\Content\ObjectState\Group $objectStateGroup
252
     */
253
    public function updateObjectStateGroup(Group $objectStateGroup)
254
    {
255
        try {
256
            return $this->innerGateway->updateObjectStateGroup($objectStateGroup);
257
        } catch (DBALException $e) {
258
            throw new RuntimeException('Database error', 0, $e);
259
        } catch (PDOException $e) {
260
            throw new RuntimeException('Database error', 0, $e);
261
        }
262
    }
263
264
    /**
265
     * Deletes the object state group identified by $groupId.
@@ 269-278 (lines=10) @@
266
     *
267
     * @param mixed $groupId
268
     */
269
    public function deleteObjectStateGroup($groupId)
270
    {
271
        try {
272
            return $this->innerGateway->deleteObjectStateGroup($groupId);
273
        } catch (DBALException $e) {
274
            throw new RuntimeException('Database error', 0, $e);
275
        } catch (PDOException $e) {
276
            throw new RuntimeException('Database error', 0, $e);
277
        }
278
    }
279
280
    /**
281
     * Sets the object state $stateId to content with $contentId ID.
@@ 287-296 (lines=10) @@
284
     * @param mixed $groupId
285
     * @param mixed $stateId
286
     */
287
    public function setContentState($contentId, $groupId, $stateId)
288
    {
289
        try {
290
            return $this->innerGateway->setContentState($contentId, $groupId, $stateId);
291
        } catch (DBALException $e) {
292
            throw new RuntimeException('Database error', 0, $e);
293
        } catch (PDOException $e) {
294
            throw new RuntimeException('Database error', 0, $e);
295
        }
296
    }
297
298
    /**
299
     * Loads object state data for $contentId content from $stateGroupId state group.
@@ 306-315 (lines=10) @@
303
     *
304
     * @return array
305
     */
306
    public function loadObjectStateDataForContent($contentId, $stateGroupId)
307
    {
308
        try {
309
            return $this->innerGateway->loadObjectStateDataForContent($contentId, $stateGroupId);
310
        } catch (DBALException $e) {
311
            throw new RuntimeException('Database error', 0, $e);
312
        } catch (PDOException $e) {
313
            throw new RuntimeException('Database error', 0, $e);
314
        }
315
    }
316
317
    /**
318
     * Returns the number of objects which are in this state.
@@ 324-333 (lines=10) @@
321
     *
322
     * @return int
323
     */
324
    public function getContentCount($stateId)
325
    {
326
        try {
327
            return $this->innerGateway->getContentCount($stateId);
328
        } catch (DBALException $e) {
329
            throw new RuntimeException('Database error', 0, $e);
330
        } catch (PDOException $e) {
331
            throw new RuntimeException('Database error', 0, $e);
332
        }
333
    }
334
335
    /**
336
     * Updates the object state priority to provided value.
@@ 341-350 (lines=10) @@
338
     * @param mixed $stateId
339
     * @param int $priority
340
     */
341
    public function updateObjectStatePriority($stateId, $priority)
342
    {
343
        try {
344
            return $this->innerGateway->updateObjectStatePriority($stateId, $priority);
345
        } catch (DBALException $e) {
346
            throw new RuntimeException('Database error', 0, $e);
347
        } catch (PDOException $e) {
348
            throw new RuntimeException('Database error', 0, $e);
349
        }
350
    }
351
}
352

eZ/Publish/Core/Persistence/Legacy/Content/Section/Gateway/ExceptionConversion.php 10 locations

@@ 46-55 (lines=10) @@
43
     *
44
     * @return int The ID of the new section
45
     */
46
    public function insertSection($name, $identifier)
47
    {
48
        try {
49
            return $this->innerGateway->insertSection($name, $identifier);
50
        } catch (DBALException $e) {
51
            throw new RuntimeException('Database error', 0, $e);
52
        } catch (PDOException $e) {
53
            throw new RuntimeException('Database error', 0, $e);
54
        }
55
    }
56
57
    /**
58
     * Updates section with $id to have $name and $identifier.
@@ 64-73 (lines=10) @@
61
     * @param string $name
62
     * @param string $identifier
63
     */
64
    public function updateSection($id, $name, $identifier)
65
    {
66
        try {
67
            return $this->innerGateway->updateSection($id, $name, $identifier);
68
        } catch (DBALException $e) {
69
            throw new RuntimeException('Database error', 0, $e);
70
        } catch (PDOException $e) {
71
            throw new RuntimeException('Database error', 0, $e);
72
        }
73
    }
74
75
    /**
76
     * Loads data for section with $id.
@@ 82-91 (lines=10) @@
79
     *
80
     * @return string[][]
81
     */
82
    public function loadSectionData($id)
83
    {
84
        try {
85
            return $this->innerGateway->loadSectionData($id);
86
        } catch (DBALException $e) {
87
            throw new RuntimeException('Database error', 0, $e);
88
        } catch (PDOException $e) {
89
            throw new RuntimeException('Database error', 0, $e);
90
        }
91
    }
92
93
    /**
94
     * Loads data for all sections.
@@ 98-107 (lines=10) @@
95
     *
96
     * @return string[][]
97
     */
98
    public function loadAllSectionData()
99
    {
100
        try {
101
            return $this->innerGateway->loadAllSectionData();
102
        } catch (DBALException $e) {
103
            throw new RuntimeException('Database error', 0, $e);
104
        } catch (PDOException $e) {
105
            throw new RuntimeException('Database error', 0, $e);
106
        }
107
    }
108
109
    /**
110
     * Loads data for section with $identifier.
@@ 116-125 (lines=10) @@
113
     *
114
     * @return string[][]
115
     */
116
    public function loadSectionDataByIdentifier($identifier)
117
    {
118
        try {
119
            return $this->innerGateway->loadSectionDataByIdentifier($identifier);
120
        } catch (DBALException $e) {
121
            throw new RuntimeException('Database error', 0, $e);
122
        } catch (PDOException $e) {
123
            throw new RuntimeException('Database error', 0, $e);
124
        }
125
    }
126
127
    /**
128
     * Counts the number of content objects assigned to section with $id.
@@ 134-143 (lines=10) @@
131
     *
132
     * @return int
133
     */
134
    public function countContentObjectsInSection($id)
135
    {
136
        try {
137
            return $this->innerGateway->countContentObjectsInSection($id);
138
        } catch (DBALException $e) {
139
            throw new RuntimeException('Database error', 0, $e);
140
        } catch (PDOException $e) {
141
            throw new RuntimeException('Database error', 0, $e);
142
        }
143
    }
144
145
    /**
146
     * Counts the number of role policies using section with $id in their limitations.
@@ 152-161 (lines=10) @@
149
     *
150
     * @return int
151
     */
152
    public function countPoliciesUsingSection($id)
153
    {
154
        try {
155
            return $this->innerGateway->countPoliciesUsingSection($id);
156
        } catch (DBALException $e) {
157
            throw new RuntimeException('Database error', 0, $e);
158
        } catch (PDOException $e) {
159
            throw new RuntimeException('Database error', 0, $e);
160
        }
161
    }
162
163
    /**
164
     * Counts the number of role assignments using section with $id in their limitations.
@@ 170-179 (lines=10) @@
167
     *
168
     * @return int
169
     */
170
    public function countRoleAssignmentsUsingSection($id)
171
    {
172
        try {
173
            return $this->innerGateway->countRoleAssignmentsUsingSection($id);
174
        } catch (DBALException $e) {
175
            throw new RuntimeException('Database error', 0, $e);
176
        } catch (PDOException $e) {
177
            throw new RuntimeException('Database error', 0, $e);
178
        }
179
    }
180
181
    /**
182
     * Deletes the Section with $id.
@@ 186-195 (lines=10) @@
183
     *
184
     * @param int $id
185
     */
186
    public function deleteSection($id)
187
    {
188
        try {
189
            return $this->innerGateway->deleteSection($id);
190
        } catch (DBALException $e) {
191
            throw new RuntimeException('Database error', 0, $e);
192
        } catch (PDOException $e) {
193
            throw new RuntimeException('Database error', 0, $e);
194
        }
195
    }
196
197
    /**
198
     * Inserts the assignment of $contentId to $sectionId.
@@ 203-212 (lines=10) @@
200
     * @param int $sectionId
201
     * @param int $contentId
202
     */
203
    public function assignSectionToContent($sectionId, $contentId)
204
    {
205
        try {
206
            return $this->innerGateway->assignSectionToContent($sectionId, $contentId);
207
        } catch (DBALException $e) {
208
            throw new RuntimeException('Database error', 0, $e);
209
        } catch (PDOException $e) {
210
            throw new RuntimeException('Database error', 0, $e);
211
        }
212
    }
213
}
214

eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/ExceptionConversion.php 25 locations

@@ 51-60 (lines=10) @@
48
     *
49
     * @return mixed Group ID
50
     */
51
    public function insertGroup(Group $group)
52
    {
53
        try {
54
            return $this->innerGateway->insertGroup($group);
55
        } catch (DBALException $e) {
56
            throw new RuntimeException('Database error', 0, $e);
57
        } catch (PDOException $e) {
58
            throw new RuntimeException('Database error', 0, $e);
59
        }
60
    }
61
62
    /**
63
     * Updates a group with data in $group.
@@ 67-76 (lines=10) @@
64
     *
65
     * @param \eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct $group
66
     */
67
    public function updateGroup(GroupUpdateStruct $group)
68
    {
69
        try {
70
            return $this->innerGateway->updateGroup($group);
71
        } catch (DBALException $e) {
72
            throw new RuntimeException('Database error', 0, $e);
73
        } catch (PDOException $e) {
74
            throw new RuntimeException('Database error', 0, $e);
75
        }
76
    }
77
78
    /**
79
     * Returns the number of types in a certain group.
@@ 85-94 (lines=10) @@
82
     *
83
     * @return int
84
     */
85
    public function countTypesInGroup($groupId)
86
    {
87
        try {
88
            return $this->innerGateway->countTypesInGroup($groupId);
89
        } catch (DBALException $e) {
90
            throw new RuntimeException('Database error', 0, $e);
91
        } catch (PDOException $e) {
92
            throw new RuntimeException('Database error', 0, $e);
93
        }
94
    }
95
96
    /**
97
     * Returns the number of Groups the type is assigned to.
@@ 104-113 (lines=10) @@
101
     *
102
     * @return int
103
     */
104
    public function countGroupsForType($typeId, $status)
105
    {
106
        try {
107
            return $this->innerGateway->countGroupsForType($typeId, $status);
108
        } catch (DBALException $e) {
109
            throw new RuntimeException('Database error', 0, $e);
110
        } catch (PDOException $e) {
111
            throw new RuntimeException('Database error', 0, $e);
112
        }
113
    }
114
115
    /**
116
     * Deletes the Group with the given $groupId.
@@ 120-129 (lines=10) @@
117
     *
118
     * @param int $groupId
119
     */
120
    public function deleteGroup($groupId)
121
    {
122
        try {
123
            return $this->innerGateway->deleteGroup($groupId);
124
        } catch (DBALException $e) {
125
            throw new RuntimeException('Database error', 0, $e);
126
        } catch (PDOException $e) {
127
            throw new RuntimeException('Database error', 0, $e);
128
        }
129
    }
130
131
    /**
132
     * Returns an array with data about the Group with $groupId.
@@ 138-147 (lines=10) @@
135
     *
136
     * @return array
137
     */
138
    public function loadGroupData($groupId)
139
    {
140
        try {
141
            return $this->innerGateway->loadGroupData($groupId);
142
        } catch (DBALException $e) {
143
            throw new RuntimeException('Database error', 0, $e);
144
        } catch (PDOException $e) {
145
            throw new RuntimeException('Database error', 0, $e);
146
        }
147
    }
148
149
    /**
150
     * Returns an array with data about the Group with $identifier.
@@ 156-165 (lines=10) @@
153
     *
154
     * @return array
155
     */
156
    public function loadGroupDataByIdentifier($identifier)
157
    {
158
        try {
159
            return $this->innerGateway->loadGroupDataByIdentifier($identifier);
160
        } catch (DBALException $e) {
161
            throw new RuntimeException('Database error', 0, $e);
162
        } catch (PDOException $e) {
163
            throw new RuntimeException('Database error', 0, $e);
164
        }
165
    }
166
167
    /**
168
     * Returns an array with data about all Group objects.
@@ 172-181 (lines=10) @@
169
     *
170
     * @return array
171
     */
172
    public function loadAllGroupsData()
173
    {
174
        try {
175
            return $this->innerGateway->loadAllGroupsData();
176
        } catch (DBALException $e) {
177
            throw new RuntimeException('Database error', 0, $e);
178
        } catch (PDOException $e) {
179
            throw new RuntimeException('Database error', 0, $e);
180
        }
181
    }
182
183
    /**
184
     * Loads data for all Types in $status in $groupId.
@@ 191-200 (lines=10) @@
188
     *
189
     * @return string[][]
190
     */
191
    public function loadTypesDataForGroup($groupId, $status)
192
    {
193
        try {
194
            return $this->innerGateway->loadTypesDataForGroup($groupId, $status);
195
        } catch (DBALException $e) {
196
            throw new RuntimeException('Database error', 0, $e);
197
        } catch (PDOException $e) {
198
            throw new RuntimeException('Database error', 0, $e);
199
        }
200
    }
201
202
    /**
203
     * Inserts a new content type.
@@ 210-219 (lines=10) @@
207
     *
208
     * @return mixed Type ID
209
     */
210
    public function insertType(Type $type, $typeId = null)
211
    {
212
        try {
213
            return $this->innerGateway->insertType($type, $typeId);
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
     * Insert assignment of $typeId to $groupId.
@@ 228-237 (lines=10) @@
225
     * @param int $status
226
     * @param mixed $groupId
227
     */
228
    public function insertGroupAssignment($typeId, $status, $groupId)
229
    {
230
        try {
231
            return $this->innerGateway->insertGroupAssignment($typeId, $status, $groupId);
232
        } catch (DBALException $e) {
233
            throw new RuntimeException('Database error', 0, $e);
234
        } catch (PDOException $e) {
235
            throw new RuntimeException('Database error', 0, $e);
236
        }
237
    }
238
239
    /**
240
     * Deletes a group assignments for a Type.
@@ 246-255 (lines=10) @@
243
     * @param mixed $typeId
244
     * @param int $status
245
     */
246
    public function deleteGroupAssignment($groupId, $typeId, $status)
247
    {
248
        try {
249
            return $this->innerGateway->deleteGroupAssignment($groupId, $typeId, $status);
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 an array with data about field definition referred $id and $status.
@@ 265-274 (lines=10) @@
262
     *
263
     * @return array Data rows.
264
     */
265
    public function loadFieldDefinition($id, $status)
266
    {
267
        try {
268
            return $this->innerGateway->loadFieldDefinition($id, $status);
269
        } catch (DBALException $e) {
270
            throw new RuntimeException('Database error', 0, $e);
271
        } catch (PDOException $e) {
272
            throw new RuntimeException('Database error', 0, $e);
273
        }
274
    }
275
276
    /**
277
     * Inserts a $fieldDefinition for $typeId.
@@ 308-317 (lines=10) @@
305
     * @param int $status
306
     * @param mixed $fieldDefinitionId
307
     */
308
    public function deleteFieldDefinition($typeId, $status, $fieldDefinitionId)
309
    {
310
        try {
311
            return $this->innerGateway->deleteFieldDefinition($typeId, $status, $fieldDefinitionId);
312
        } catch (DBALException $e) {
313
            throw new RuntimeException('Database error', 0, $e);
314
        } catch (PDOException $e) {
315
            throw new RuntimeException('Database error', 0, $e);
316
        }
317
    }
318
319
    /**
320
     * Updates a $fieldDefinition for $typeId.
@@ 349-358 (lines=10) @@
346
     * @param int $status
347
     * @param \eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct $updateStruct
348
     */
349
    public function updateType($typeId, $status, UpdateStruct $updateStruct)
350
    {
351
        try {
352
            return $this->innerGateway->updateType($typeId, $status, $updateStruct);
353
        } catch (DBALException $e) {
354
            throw new RuntimeException('Database error', 0, $e);
355
        } catch (PDOException $e) {
356
            throw new RuntimeException('Database error', 0, $e);
357
        }
358
    }
359
360
    /**
361
     * Loads an array with data about $typeId in $status.
@@ 368-377 (lines=10) @@
365
     *
366
     * @return array Data rows.
367
     */
368
    public function loadTypeData($typeId, $status)
369
    {
370
        try {
371
            return $this->innerGateway->loadTypeData($typeId, $status);
372
        } catch (DBALException $e) {
373
            throw new RuntimeException('Database error', 0, $e);
374
        } catch (PDOException $e) {
375
            throw new RuntimeException('Database error', 0, $e);
376
        }
377
    }
378
379
    /**
380
     * Loads an array with data about the type referred to by $identifier in
@@ 388-397 (lines=10) @@
385
     *
386
     * @return array(int=>array(string=>mixed)) Data rows.
387
     */
388
    public function loadTypeDataByIdentifier($identifier, $status)
389
    {
390
        try {
391
            return $this->innerGateway->loadTypeDataByIdentifier($identifier, $status);
392
        } catch (DBALException $e) {
393
            throw new RuntimeException('Database error', 0, $e);
394
        } catch (PDOException $e) {
395
            throw new RuntimeException('Database error', 0, $e);
396
        }
397
    }
398
399
    /**
400
     * Loads an array with data about the type referred to by $remoteId in
@@ 408-417 (lines=10) @@
405
     *
406
     * @return array(int=>array(string=>mixed)) Data rows.
407
     */
408
    public function loadTypeDataByRemoteId($remoteId, $status)
409
    {
410
        try {
411
            return $this->innerGateway->loadTypeDataByRemoteId($remoteId, $status);
412
        } catch (DBALException $e) {
413
            throw new RuntimeException('Database error', 0, $e);
414
        } catch (PDOException $e) {
415
            throw new RuntimeException('Database error', 0, $e);
416
        }
417
    }
418
419
    /**
420
     * Counts the number of instances that exists of the identified type.
@@ 426-435 (lines=10) @@
423
     *
424
     * @return int
425
     */
426
    public function countInstancesOfType($typeId)
427
    {
428
        try {
429
            return $this->innerGateway->countInstancesOfType($typeId);
430
        } catch (DBALException $e) {
431
            throw new RuntimeException('Database error', 0, $e);
432
        } catch (PDOException $e) {
433
            throw new RuntimeException('Database error', 0, $e);
434
        }
435
    }
436
437
    /**
438
     * Deletes a Type completely.
@@ 443-452 (lines=10) @@
440
     * @param mixed $typeId
441
     * @param int $status
442
     */
443
    public function delete($typeId, $status)
444
    {
445
        try {
446
            return $this->innerGateway->delete($typeId, $status);
447
        } catch (DBALException $e) {
448
            throw new RuntimeException('Database error', 0, $e);
449
        } catch (PDOException $e) {
450
            throw new RuntimeException('Database error', 0, $e);
451
        }
452
    }
453
454
    /**
455
     * Deletes all field definitions of a Type.
@@ 460-469 (lines=10) @@
457
     * @param mixed $typeId
458
     * @param int $status
459
     */
460
    public function deleteFieldDefinitionsForType($typeId, $status)
461
    {
462
        try {
463
            return $this->innerGateway->deleteFieldDefinitionsForType($typeId, $status);
464
        } catch (DBALException $e) {
465
            throw new RuntimeException('Database error', 0, $e);
466
        } catch (PDOException $e) {
467
            throw new RuntimeException('Database error', 0, $e);
468
        }
469
    }
470
471
    /**
472
     * Deletes a the Type.
@@ 479-488 (lines=10) @@
476
     * @param mixed $typeId
477
     * @param int $status
478
     */
479
    public function deleteType($typeId, $status)
480
    {
481
        try {
482
            return $this->innerGateway->deleteType($typeId, $status);
483
        } catch (DBALException $e) {
484
            throw new RuntimeException('Database error', 0, $e);
485
        } catch (PDOException $e) {
486
            throw new RuntimeException('Database error', 0, $e);
487
        }
488
    }
489
490
    /**
491
     * Deletes all group assignments for a Type.
@@ 496-505 (lines=10) @@
493
     * @param mixed $typeId
494
     * @param int $status
495
     */
496
    public function deleteGroupAssignmentsForType($typeId, $status)
497
    {
498
        try {
499
            return $this->innerGateway->deleteGroupAssignmentsForType($typeId, $status);
500
        } catch (DBALException $e) {
501
            throw new RuntimeException('Database error', 0, $e);
502
        } catch (PDOException $e) {
503
            throw new RuntimeException('Database error', 0, $e);
504
        }
505
    }
506
507
    /**
508
     * Publishes the Type with $typeId from $sourceVersion to $targetVersion,
@@ 515-524 (lines=10) @@
512
     * @param int $sourceStatus
513
     * @param int $targetStatus
514
     */
515
    public function publishTypeAndFields($typeId, $sourceStatus, $targetStatus)
516
    {
517
        try {
518
            return $this->innerGateway->publishTypeAndFields($typeId, $sourceStatus, $targetStatus);
519
        } catch (DBALException $e) {
520
            throw new RuntimeException('Database error', 0, $e);
521
        } catch (PDOException $e) {
522
            throw new RuntimeException('Database error', 0, $e);
523
        }
524
    }
525
526
    /**
527
     * Returns searchable field mapping data.
@@ 531-540 (lines=10) @@
528
     *
529
     * @return array
530
     */
531
    public function getSearchableFieldMapData()
532
    {
533
        try {
534
            return $this->innerGateway->getSearchableFieldMapData();
535
        } catch (DBALException $e) {
536
            throw new RuntimeException('Database error', 0, $e);
537
        } catch (PDOException $e) {
538
            throw new RuntimeException('Database error', 0, $e);
539
        }
540
    }
541
}
542

eZ/Publish/Core/Persistence/Legacy/Content/UrlWildcard/Gateway/ExceptionConversion.php 4 locations

@@ 45-54 (lines=10) @@
42
     *
43
     * @return mixed
44
     */
45
    public function insertUrlWildcard(UrlWildcard $urlWildcard)
46
    {
47
        try {
48
            return $this->innerGateway->insertUrlWildcard($urlWildcard);
49
        } catch (DBALException $e) {
50
            throw new \RuntimeException('Database error', 0, $e);
51
        } catch (PDOException $e) {
52
            throw new \RuntimeException('Database error', 0, $e);
53
        }
54
    }
55
56
    /**
57
     * Deletes the UrlWildcard with given $id.
@@ 61-70 (lines=10) @@
58
     *
59
     * @param mixed $id
60
     */
61
    public function deleteUrlWildcard($id)
62
    {
63
        try {
64
            return $this->innerGateway->deleteUrlWildcard($id);
65
        } catch (DBALException $e) {
66
            throw new \RuntimeException('Database error', 0, $e);
67
        } catch (PDOException $e) {
68
            throw new \RuntimeException('Database error', 0, $e);
69
        }
70
    }
71
72
    /**
73
     * @param mixed $parentId
@@ 77-86 (lines=10) @@
74
     *
75
     * @return array
76
     */
77
    public function loadUrlWildcardData($parentId)
78
    {
79
        try {
80
            return $this->innerGateway->loadUrlWildcardData($parentId);
81
        } catch (DBALException $e) {
82
            throw new \RuntimeException('Database error', 0, $e);
83
        } catch (PDOException $e) {
84
            throw new \RuntimeException('Database error', 0, $e);
85
        }
86
    }
87
88
    /**
89
     * Loads an array with data about UrlWildcards (paged).
@@ 96-105 (lines=10) @@
93
     *
94
     * @return array
95
     */
96
    public function loadUrlWildcardsData($offset = 0, $limit = -1)
97
    {
98
        try {
99
            return $this->innerGateway->loadUrlWildcardsData($offset, $limit);
100
        } catch (DBALException $e) {
101
            throw new \RuntimeException('Database error', 0, $e);
102
        } catch (PDOException $e) {
103
            throw new \RuntimeException('Database error', 0, $e);
104
        }
105
    }
106
}
107

eZ/Publish/Core/Persistence/Legacy/URL/Gateway/ExceptionConversion.php 4 locations

@@ 38-47 (lines=10) @@
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function updateUrl(URL $url)
39
    {
40
        try {
41
            return $this->innerGateway->updateUrl($url);
42
        } catch (DBALException $e) {
43
            throw new RuntimeException('Database error', 0, $e);
44
        } catch (PDOException $e) {
45
            throw new RuntimeException('Database error', 0, $e);
46
        }
47
    }
48
49
    /**
50
     * {@inheritdoc}
@@ 66-75 (lines=10) @@
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function findUsages($id)
67
    {
68
        try {
69
            return $this->innerGateway->findUsages($id);
70
        } catch (DBALException $e) {
71
            throw new RuntimeException('Database error', 0, $e);
72
        } catch (PDOException $e) {
73
            throw new RuntimeException('Database error', 0, $e);
74
        }
75
    }
76
77
    /**
78
     * {@inheritdoc}
@@ 80-89 (lines=10) @@
77
    /**
78
     * {@inheritdoc}
79
     */
80
    public function loadUrlData($id)
81
    {
82
        try {
83
            return $this->innerGateway->loadUrlData($id);
84
        } catch (DBALException $e) {
85
            throw new RuntimeException('Database error', 0, $e);
86
        } catch (PDOException $e) {
87
            throw new RuntimeException('Database error', 0, $e);
88
        }
89
    }
90
91
    /**
92
     * {@inheritdoc}
@@ 94-103 (lines=10) @@
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function loadUrlDataByUrl($url)
95
    {
96
        try {
97
            return $this->innerGateway->loadUrlDataByUrl($url);
98
        } catch (DBALException $e) {
99
            throw new RuntimeException('Database error', 0, $e);
100
        } catch (PDOException $e) {
101
            throw new RuntimeException('Database error', 0, $e);
102
        }
103
    }
104
}
105

eZ/Publish/Core/Persistence/Legacy/User/Gateway/ExceptionConversion.php 3 locations

@@ 80-89 (lines=10) @@
77
     *
78
     * @return array
79
     */
80
    public function load($userId)
81
    {
82
        try {
83
            return $this->innerGateway->load($userId);
84
        } catch (DBALException $e) {
85
            throw new RuntimeException('Database error', 0, $e);
86
        } catch (PDOException $e) {
87
            throw new RuntimeException('Database error', 0, $e);
88
        }
89
    }
90
91
    /**
92
     * Loads user with user login.
@@ 150-159 (lines=10) @@
147
     * @param mixed $roleId
148
     * @param array $limitation
149
     */
150
    public function assignRole($contentId, $roleId, array $limitation)
151
    {
152
        try {
153
            return $this->innerGateway->assignRole($contentId, $roleId, $limitation);
154
        } catch (DBALException $e) {
155
            throw new RuntimeException('Database error', 0, $e);
156
        } catch (PDOException $e) {
157
            throw new RuntimeException('Database error', 0, $e);
158
        }
159
    }
160
161
    /**
162
     * Remove role from user or user group.
@@ 167-176 (lines=10) @@
164
     * @param mixed $contentId
165
     * @param mixed $roleId
166
     */
167
    public function removeRole($contentId, $roleId)
168
    {
169
        try {
170
            return $this->innerGateway->removeRole($contentId, $roleId);
171
        } catch (DBALException $e) {
172
            throw new RuntimeException('Database error', 0, $e);
173
        } catch (PDOException $e) {
174
            throw new RuntimeException('Database error', 0, $e);
175
        }
176
    }
177
178
    /**
179
     * Remove role from user or user group, by assignment ID.