Code Duplication    Length = 14-17 lines in 3 locations

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

@@ 222-238 (lines=17) @@
219
    /**
220
     * {@inheritdoc}
221
     */
222
    public function create(CreateStruct $contentType)
223
    {
224
        $this->logger->logCall(__METHOD__, array('struct' => $contentType));
225
        $type = $this->persistenceHandler->contentTypeHandler()->create($contentType);
226
227
        if ($type->status === Type::STATUS_DEFINED) {
228
            // Warm-up cache
229
            $this->cache->save(
230
                $this->cache->getItem('ez-content-type-'.$type->id)
231
                    ->set($type)
232
                    ->tag('type-'.$type->id)
233
            );
234
            $this->cache->invalidateTags(['type-map']);
235
        }
236
237
        return $type;
238
    }
239
240
    /**
241
     * {@inheritdoc}

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

@@ 216-232 (lines=17) @@
213
    /**
214
     * {@inheritdoc}
215
     */
216
    public function create(CreateStruct $locationStruct)
217
    {
218
        $this->logger->logCall(__METHOD__, array('struct' => $locationStruct));
219
        $location = $this->persistenceHandler->locationHandler()->create($locationStruct);
220
221
        // invalidate cache connected to the content
222
        $this->cache->invalidateTags(['content-'.$locationStruct->contentId]);
223
224
        // warm-up cache
225
        $this->cache->save(
226
            $this->cache->getItem('location-'.$location->id)
227
                ->set($location)
228
                ->tag($this->getCacheTags($location))
229
        );
230
231
        return $location;
232
    }
233
234
    /**
235
     * {@inheritdoc}

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

@@ 22-35 (lines=14) @@
19
    /**
20
     * @see \eZ\Publish\SPI\Persistence\Content\ObjectState\Handler::createGroup
21
     */
22
    public function createGroup(InputStruct $input)
23
    {
24
        $this->logger->logCall(__METHOD__, array('struct' => $input));
25
        $group = $this->persistenceHandler->objectStateHandler()->createGroup($input);
26
27
        $this->cache->deleteItem('ez-state-group-all');
28
        $this->cache->save(
29
            $this->cache->getItem('ez-state-group-'.$group->id)
30
                ->set($group)
31
                ->tag(['state-group-'.$group->id])
32
        );
33
34
        return $group;
35
    }
36
37
    /**
38
     * @see \eZ\Publish\SPI\Persistence\Content\ObjectState\Handler::loadGroup