Code Duplication    Length = 7-13 lines in 6 locations

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

@@ 41-49 (lines=9) @@
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function updateGroup(GroupUpdateStruct $struct)
42
    {
43
        $this->logger->logCall(__METHOD__, array('struct' => $struct));
44
        $group = $this->persistenceHandler->contentTypeHandler()->updateGroup($struct);
45
46
        $this->cache->invalidateTags(['type-group-' . $struct->id]);
47
48
        return $group;
49
    }
50
51
    /**
52
     * {@inheritdoc}
@@ 54-62 (lines=9) @@
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function deleteGroup($groupId)
55
    {
56
        $this->logger->logCall(__METHOD__, array('group' => $groupId));
57
        $return = $this->persistenceHandler->contentTypeHandler()->deleteGroup($groupId);
58
59
        $this->cache->invalidateTags(['type-group-' . $groupId]);
60
61
        return $return;
62
    }
63
64
    /**
65
     * {@inheritdoc}
@@ 244-256 (lines=13) @@
241
    /**
242
     * {@inheritdoc}
243
     */
244
    public function create(CreateStruct $struct)
245
    {
246
        $this->logger->logCall(__METHOD__, array('struct' => $struct));
247
248
        $type = $this->persistenceHandler->contentTypeHandler()->create($struct);
249
250
        // Clear loadContentTypes() cache as we effetely add an item to it's collection here.
251
        foreach ($struct->groupIds as $groupId) {
252
            $this->cache->deleteItem('ez-content-type-list-by-group-' . $groupId);
253
        }
254
255
        return $type;
256
    }
257
258
    /**
259
     * {@inheritdoc}

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

@@ 149-157 (lines=9) @@
146
    /**
147
     * {@inheritdoc}
148
     */
149
    public function create($groupId, InputStruct $input)
150
    {
151
        $this->logger->logCall(__METHOD__, array('groupId' => $groupId, 'struct' => $input));
152
        $return = $this->persistenceHandler->objectStateHandler()->create($groupId, $input);
153
154
        $this->cache->deleteItem('ez-state-list-by-group-' . $groupId);
155
156
        return $return;
157
    }
158
159
    /**
160
     * {@inheritdoc}

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

@@ 235-241 (lines=7) @@
232
     *
233
     * @param int $id Location ID
234
     */
235
    public function setInvisible(int $id): void
236
    {
237
        $this->logger->logCall(__METHOD__, ['location' => $id]);
238
        $this->persistenceHandler->locationHandler()->setInvisible($id);
239
240
        $this->cache->invalidateTags(['location-path-data-' . $id]);
241
    }
242
243
    /**
244
     * Sets a location + all children to visible.
@@ 248-254 (lines=7) @@
245
     *
246
     * @param int $id Location ID
247
     */
248
    public function setVisible(int $id): void
249
    {
250
        $this->logger->logCall(__METHOD__, ['location' => $id]);
251
        $this->persistenceHandler->locationHandler()->setVisible($id);
252
253
        $this->cache->invalidateTags(['location-path-data-' . $id]);
254
    }
255
256
    /**
257
     * {@inheritdoc}