Code Duplication    Length = 9-13 lines in 6 locations

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

@@ 227-237 (lines=11) @@
224
    /**
225
     * {@inheritdoc}
226
     */
227
    public function create(CreateStruct $locationStruct)
228
    {
229
        $this->logger->logCall(__METHOD__, array('struct' => $locationStruct));
230
        $location = $this->persistenceHandler->locationHandler()->create($locationStruct);
231
232
        // need to clear loadLocationsByContent and similar collections involving locations data
233
        // also need to clear content info on main location changes
234
        $this->cache->invalidateTags(['content-' . $locationStruct->contentId, 'role-assignment-group-list-' . $locationStruct->contentId]);
235
236
        return $location;
237
    }
238
239
    /**
240
     * {@inheritdoc}

eZ/Publish/Core/Persistence/Cache/UserHandler.php 2 locations

@@ 106-115 (lines=10) @@
103
    /**
104
     * {@inheritdoc}
105
     */
106
    public function update(User $user)
107
    {
108
        $this->logger->logCall(__METHOD__, array('struct' => $user));
109
        $return = $this->persistenceHandler->userHandler()->update($user);
110
111
        // Clear corresponding content cache as update of the User changes it's external data
112
        $this->cache->invalidateTags(['content-fields-' . $user->id, 'user-' . $user->id]);
113
114
        return $return;
115
    }
116
117
    /**
118
     * {@inheritdoc}
@@ 376-384 (lines=9) @@
373
    /**
374
     * {@inheritdoc}
375
     */
376
    public function updatePolicy(Policy $policy)
377
    {
378
        $this->logger->logCall(__METHOD__, array('struct' => $policy));
379
        $return = $this->persistenceHandler->userHandler()->updatePolicy($policy);
380
381
        $this->cache->invalidateTags(['policy-' . $policy->id, 'role-' . $policy->roleId]);
382
383
        return $return;
384
    }
385
386
    /**
387
     * {@inheritdoc}

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

@@ 276-284 (lines=9) @@
273
    /**
274
     * {@inheritdoc}
275
     */
276
    public function locationDeleted($locationId)
277
    {
278
        $this->logger->logCall(__METHOD__, array('location' => $locationId));
279
        $return = $this->persistenceHandler->urlAliasHandler()->locationDeleted($locationId);
280
281
        $this->cache->invalidateTags(['urlAlias-location-' . $locationId, 'urlAlias-location-path-' . $locationId]);
282
283
        return $return;
284
    }
285
286
    /**
287
     * {@inheritdoc}

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

@@ 345-357 (lines=13) @@
342
    /**
343
     * {@inheritdoc}
344
     */
345
    public function deleteTranslationFromContent($contentId, $languageCode)
346
    {
347
        $this->logger->logCall(
348
            __METHOD__,
349
            [
350
                'contentId' => $contentId,
351
                'languageCode' => $languageCode,
352
            ]
353
        );
354
355
        $this->persistenceHandler->contentHandler()->deleteTranslationFromContent($contentId, $languageCode);
356
        $this->cache->invalidateTags(['content-' . $contentId]);
357
    }
358
359
    /**
360
     * {@inheritdoc}

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

@@ 23-35 (lines=13) @@
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function updateUrl($id, URLUpdateStruct $struct)
24
    {
25
        $this->logger->logCall(__METHOD__, [
26
            'url' => $id,
27
            'struct' => $struct,
28
        ]);
29
30
        $url = $this->persistenceHandler->urlHandler()->updateUrl($id, $struct);
31
32
        $this->cache->invalidateTags(['url-' . $id]);
33
34
        return $url;
35
    }
36
37
    /**
38
     * {@inheritdoc}