Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 131-151 (lines=21) @@
128
    /**
129
     * {@inheritdoc}
130
     */
131
    public function listURLAliasesForLocation($locationId, $custom = false)
132
    {
133
        $cacheItem = $this->cache->getItem('ez-urlAlias-location-list-' . $locationId . ($custom ? '-custom' : ''));
134
        if ($cacheItem->isHit()) {
135
            return $cacheItem->get();
136
        }
137
138
        $this->logger->logCall(__METHOD__, array('location' => $locationId, 'custom' => $custom));
139
        $urlAliases = $this->persistenceHandler->urlAliasHandler()->listURLAliasesForLocation($locationId, $custom);
140
141
        $cacheItem->set($urlAliases);
142
        $cacheTags = ['urlAlias-location-' . $locationId];
143
        foreach ($urlAliases as $urlAlias) {
144
            $cacheTags[] = 'urlAlias-' . $urlAlias->id;
145
        }
146
        $cacheItem->tag($cacheTags);
147
        $this->cache->save($cacheItem);
148
149
        return $urlAliases;
150
    }
151
152
    /**
153
     * {@inheritdoc}
154
     */

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

@@ 44-64 (lines=21) @@
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function loadSubtreeIds($locationId)
45
    {
46
        $cacheItem = $this->cache->getItem("ez-location-subtree-${locationId}");
47
        if ($cacheItem->isHit()) {
48
            return $cacheItem->get();
49
        }
50
51
        $this->logger->logCall(__METHOD__, array('location' => $locationId));
52
        $locationIds = $this->persistenceHandler->locationHandler()->loadSubtreeIds($locationId);
53
54
        $cacheItem->set($locationIds);
55
        $cacheTags = ['location-' . $locationId, 'location-path-' . $locationId];
56
        foreach ($locationIds as $locationId) {
57
            $cacheTags[] = 'location-' . $locationId;
58
            $cacheTags[] = 'location-path-' . $locationId;
59
        }
60
        $cacheItem->tag($cacheTags);
61
        $this->cache->save($cacheItem);
62
63
        return $locationIds;
64
    }
65
66
    /**
67
     * {@inheritdoc}