Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 87-109 (lines=23) @@
84
    /**
85
     * {@inheritdoc}
86
     */
87
    public function loadGroups(array $groupIds)
88
    {
89
        list($cacheMissIds, $list) = $this->getMultipleCacheItems($groupIds, 'ez-content-type-group-');
90
        if (empty($cacheMissIds)) {
91
            return $list;
92
        }
93
94
        // Load cache misses
95
        $this->logger->logCall(__METHOD__, array('groups' => $cacheMissIds));
96
        $cacheMissList = $this->persistenceHandler->contentTypeHandler()->loadGroups($cacheMissIds);
97
98
        // Populate cache misses with data and set final group data instead on list
99
        foreach ($cacheMissList as $id => $group) {
100
            $this->cache->save(
101
                $list[$id]
102
                    ->set($group)
103
                    ->tag('type-group-' . $id)
104
            );
105
            $list[$id] = $group;
106
        }
107
108
        return $list;
109
    }
110
111
    /**
112
     * {@inheritdoc}

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

@@ 99-121 (lines=23) @@
96
        return $contentInfo;
97
    }
98
99
    public function loadContentInfoList(array $contentIds)
100
    {
101
        list($cacheMisses, $list) = $this->getMultipleCacheItems($contentIds, 'ez-content-info-');
102
        if (empty($cacheMisses)) {
103
            return $list;
104
        }
105
106
        // Load cache misses
107
        $this->logger->logCall(__METHOD__, array('content' => $cacheMisses));
108
        $cacheMissList = $this->persistenceHandler->contentHandler()->loadContentInfoList($cacheMisses);
109
110
        // Populate cache misses with data and set final info data instead on list
111
        foreach ($cacheMissList as $id => $contentInfo) {
112
            $this->cache->save(
113
                $list[$id]
114
                    ->set($contentInfo)
115
                    ->tag($this->getCacheTags($contentInfo))
116
            );
117
            $list[$id] = $contentInfo;
118
        }
119
120
        return $list;
121
    }
122
123
    /**
124
     * {@inheritdoc}