Code Duplication    Length = 7-10 lines in 4 locations

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

@@ 504-513 (lines=10) @@
501
        return $return;
502
    }
503
504
    public function deleteByUserAndStatus(int $userId, int $status): void
505
    {
506
        $this->logger->logCall(__METHOD__, ['user' => $userId, 'status' => $status]);
507
508
        $this->persistenceHandler->contentTypeHandler()->deleteByUserAndStatus($userId, $status);
509
        if ($status === Type::STATUS_DEFINED) {
510
            // As we don't have indication of affected type id's yet here, we need to clear all type cache for now.
511
            $this->cache->invalidateTags(['type']);
512
        }
513
    }
514
}
515

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

@@ 318-324 (lines=7) @@
315
    /**
316
     * {@inheritdoc}
317
     */
318
    public function update(UpdateStruct $struct, $locationId)
319
    {
320
        $this->logger->logCall(__METHOD__, ['location' => $locationId, 'struct' => $struct]);
321
        $this->persistenceHandler->locationHandler()->update($struct, $locationId);
322
323
        $this->cache->invalidateTags(['location-' . $locationId]);
324
    }
325
326
    /**
327
     * {@inheritdoc}
@@ 357-363 (lines=7) @@
354
    /**
355
     * {@inheritdoc}
356
     */
357
    public function setSectionForSubtree($locationId, $sectionId)
358
    {
359
        $this->logger->logCall(__METHOD__, ['location' => $locationId, 'section' => $sectionId]);
360
        $this->persistenceHandler->locationHandler()->setSectionForSubtree($locationId, $sectionId);
361
362
        $this->cache->invalidateTags(['location-path-' . $locationId]);
363
    }
364
365
    /**
366
     * {@inheritdoc}
@@ 368-374 (lines=7) @@
365
    /**
366
     * {@inheritdoc}
367
     */
368
    public function changeMainLocation($contentId, $locationId)
369
    {
370
        $this->logger->logCall(__METHOD__, ['location' => $locationId, 'content' => $contentId]);
371
        $this->persistenceHandler->locationHandler()->changeMainLocation($contentId, $locationId);
372
373
        $this->cache->invalidateTags(['content-' . $contentId]);
374
    }
375
376
    /**
377
     * Get the total number of all existing Locations. Can be combined with loadAllLocations.