Code Duplication    Length = 20-20 lines in 2 locations

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

@@ 99-118 (lines=20) @@
96
    /**
97
     * {@inheritdoc}
98
     */
99
    public function loadParentLocationsForDraftContent($contentId)
100
    {
101
        $cacheItem = $this->cache->getItem("ez-content-locations-${contentId}-parentForDraft");
102
        if ($cacheItem->isHit()) {
103
            return $cacheItem->get();
104
        }
105
106
        $this->logger->logCall(__METHOD__, array('content' => $contentId));
107
        $locations = $this->persistenceHandler->locationHandler()->loadParentLocationsForDraftContent($contentId);
108
109
        $cacheItem->set($locations);
110
        $cacheTags = ['content-' . $contentId];
111
        foreach ($locations as $location) {
112
            $cacheTags = $this->getCacheTags($location, $cacheTags);
113
        }
114
        $cacheItem->tag($cacheTags);
115
        $this->cache->save($cacheItem);
116
117
        return $locations;
118
    }
119
120
    /**
121
     * {@inheritdoc}

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

@@ 292-311 (lines=20) @@
289
    /**
290
     * {@inheritdoc}
291
     */
292
    public function loadRoleAssignmentsByRoleId($roleId)
293
    {
294
        $cacheItem = $this->cache->getItem("ez-role-assignment-${roleId}-by-role");
295
        if ($cacheItem->isHit()) {
296
            return $cacheItem->get();
297
        }
298
299
        $this->logger->logCall(__METHOD__, array('role' => $roleId));
300
        $roleAssignments = $this->persistenceHandler->userHandler()->loadRoleAssignmentsByRoleId($roleId);
301
302
        $cacheItem->set($roleAssignments);
303
        $cacheTags = ['role-assignment-role-list-' . $roleId];
304
        foreach ($roleAssignments as $roleAssignment) {
305
            $cacheTags = $this->getCacheTagsForRoleAssignment($roleAssignment, $cacheTags);
306
        }
307
        $cacheItem->tag($cacheTags);
308
        $this->cache->save($cacheItem);
309
310
        return $roleAssignments;
311
    }
312
313
    /**
314
     * {@inheritdoc}