Code Duplication    Length = 8-20 lines in 8 locations

eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php 3 locations

@@ 245-261 (lines=17) @@
242
    /**
243
     * {@inheritdoc}
244
     */
245
    public function locationMoved($locationId, $oldParentId, $newParentId)
246
    {
247
        $this->logger->logCall(
248
            __METHOD__,
249
            [
250
                'location' => $locationId,
251
                'oldParent' => $oldParentId,
252
                'newParent' => $newParentId,
253
            ]
254
        );
255
256
        $return = $this->persistenceHandler->urlAliasHandler()->locationMoved($locationId, $oldParentId, $newParentId);
257
258
        $this->cache->invalidateTags(['urlAlias-location-' . $locationId, 'urlAlias-location-path-' . $locationId]);
259
260
        return $return;
261
    }
262
263
    /**
264
     * {@inheritdoc}
@@ 266-285 (lines=20) @@
263
    /**
264
     * {@inheritdoc}
265
     */
266
    public function locationCopied($locationId, $newLocationId, $newParentId)
267
    {
268
        $this->logger->logCall(
269
            __METHOD__,
270
            [
271
                'oldLocation' => $locationId,
272
                'newLocation' => $newLocationId,
273
                'newParent' => $newParentId,
274
            ]
275
        );
276
277
        $return = $this->persistenceHandler->urlAliasHandler()->locationCopied(
278
            $locationId,
279
            $newLocationId,
280
            $newParentId
281
        );
282
        $this->cache->invalidateTags(['urlAlias-location-' . $locationId, 'urlAlias-location-' . $newLocationId]);
283
284
        return $return;
285
    }
286
287
    /**
288
     * {@inheritdoc}
@@ 358-376 (lines=19) @@
355
    /**
356
     * {@inheritdoc}
357
     */
358
    public function archiveUrlAliasesForDeletedTranslations($locationId, $parentLocationId, array $languageCodes)
359
    {
360
        $this->logger->logCall(
361
            __METHOD__,
362
            [
363
                'locationId' => $locationId,
364
                'parentLocationId' => $parentLocationId,
365
                'languageCodes' => implode(',', $languageCodes),
366
            ]
367
        );
368
369
        $this->persistenceHandler->urlAliasHandler()->archiveUrlAliasesForDeletedTranslations(
370
            $locationId,
371
            $parentLocationId,
372
            $languageCodes
373
        );
374
375
        $this->cache->invalidateTags(['urlAlias-location-' . $locationId, 'urlAlias-location-path-' . $locationId]);
376
    }
377
378
    /**
379
     * Return relevant UrlAlias and optionally UrlAlias location tags so cache can be purged reliably.

eZ/Publish/Core/Persistence/Cache/ContentTypeHandler.php 1 location

@@ 507-518 (lines=12) @@
504
     *
505
     * @throws \Psr\Cache\InvalidArgumentException
506
     */
507
    public function removeContentTypeTranslation(int $contentTypeId, string $languageCode): Type
508
    {
509
        $this->logger->logCall(__METHOD__, ['id' => $contentTypeId, 'languageCode' => $languageCode]);
510
        $return = $this->persistenceHandler->contentTypeHandler()->removeContentTypeTranslation(
511
            $contentTypeId,
512
            $languageCode
513
        );
514
515
        $this->cache->invalidateTags(['type-' . $contentTypeId, 'type-map', 'content-fields-type-' . $contentTypeId]);
516
517
        return $return;
518
    }
519
520
    public function deleteByUserAndStatus(int $userId, int $status): void
521
    {

eZ/Publish/Core/Persistence/Cache/UserHandler.php 1 location

@@ 512-520 (lines=9) @@
509
    /**
510
     * {@inheritdoc}
511
     */
512
    public function unassignRole($contentId, $roleId)
513
    {
514
        $this->logger->logCall(__METHOD__, ['group' => $contentId, 'role' => $roleId]);
515
        $return = $this->persistenceHandler->userHandler()->unassignRole($contentId, $roleId);
516
517
        $this->cache->invalidateTags(['role-assignment-group-list-' . $contentId, 'role-assignment-role-list-' . $roleId]);
518
519
        return $return;
520
    }
521
522
    /**
523
     * {@inheritdoc}

eZ/Publish/Core/Persistence/Cache/ContentHandler.php 3 locations

@@ 270-277 (lines=8) @@
267
    /**
268
     * {@inheritdoc}
269
     */
270
    public function updateMetadata($contentId, MetadataUpdateStruct $struct)
271
    {
272
        $this->logger->logCall(__METHOD__, ['content' => $contentId, 'struct' => $struct]);
273
        $contentInfo = $this->persistenceHandler->contentHandler()->updateMetadata($contentId, $struct);
274
        $this->cache->invalidateTags(['content-' . $contentId]);
275
276
        return $contentInfo;
277
    }
278
279
    /**
280
     * {@inheritdoc}
@@ 326-333 (lines=8) @@
323
    /**
324
     * {@inheritdoc}
325
     */
326
    public function deleteVersion($contentId, $versionNo)
327
    {
328
        $this->logger->logCall(__METHOD__, ['content' => $contentId, 'version' => $versionNo]);
329
        $return = $this->persistenceHandler->contentHandler()->deleteVersion($contentId, $versionNo);
330
        $this->cache->invalidateTags(["content-{$contentId}-version-{$versionNo}"]);
331
332
        return $return;
333
    }
334
335
    /**
336
     * {@inheritdoc}
@@ 429-441 (lines=13) @@
426
    /**
427
     * {@inheritdoc}
428
     */
429
    public function deleteTranslationFromContent($contentId, $languageCode)
430
    {
431
        $this->logger->logCall(
432
            __METHOD__,
433
            [
434
                'contentId' => $contentId,
435
                'languageCode' => $languageCode,
436
            ]
437
        );
438
439
        $this->persistenceHandler->contentHandler()->deleteTranslationFromContent($contentId, $languageCode);
440
        $this->cache->invalidateTags(['content-' . $contentId]);
441
    }
442
443
    /**
444
     * {@inheritdoc}