Code Duplication    Length = 8-24 lines in 8 locations

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

@@ 167-174 (lines=8) @@
164
    /**
165
     * {@inheritdoc}
166
     */
167
    public function updateContent($contentId, $versionNo, UpdateStruct $struct)
168
    {
169
        $this->logger->logCall(__METHOD__, array('content' => $contentId, 'version' => $versionNo, 'struct' => $struct));
170
        $content = $this->persistenceHandler->contentHandler()->updateContent($contentId, $versionNo, $struct);
171
        $this->cache->clear('content', $contentId, $versionNo);
172
173
        return $content;
174
    }
175
176
    /**
177
     * {@inheritdoc}
@@ 334-348 (lines=15) @@
331
    /**
332
     * {@inheritdoc}
333
     */
334
    public function deleteTranslationFromDraft($contentId, $versionNo, $languageCode)
335
    {
336
        $this->logger->logCall(
337
            __METHOD__,
338
            ['content' => $contentId, 'version' => $versionNo, 'languageCode' => $languageCode]
339
        );
340
        $content = $this->persistenceHandler->contentHandler()->deleteTranslationFromDraft(
341
            $contentId,
342
            $versionNo,
343
            $languageCode
344
        );
345
        $this->cache->clear('content', $contentId, $versionNo);
346
347
        return $content;
348
    }
349
}
350

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

@@ 251-261 (lines=11) @@
248
    /**
249
     * {@inheritdoc}
250
     */
251
    public function unlink($groupId, $typeId, $status)
252
    {
253
        $this->logger->logCall(__METHOD__, array('group' => $groupId, 'type' => $typeId, 'status' => $status));
254
        $return = $this->persistenceHandler->contentTypeHandler()->unlink($groupId, $typeId, $status);
255
256
        if ($status === Type::STATUS_DEFINED) {
257
            $this->cache->clear('contentType', $typeId);
258
        }
259
260
        return $return;
261
    }
262
263
    /**
264
     * {@inheritdoc}
@@ 266-276 (lines=11) @@
263
    /**
264
     * {@inheritdoc}
265
     */
266
    public function link($groupId, $typeId, $status)
267
    {
268
        $this->logger->logCall(__METHOD__, array('group' => $groupId, 'type' => $typeId, 'status' => $status));
269
        $return = $this->persistenceHandler->contentTypeHandler()->link($groupId, $typeId, $status);
270
271
        if ($status === Type::STATUS_DEFINED) {
272
            $this->cache->clear('contentType', $typeId);
273
        }
274
275
        return $return;
276
    }
277
278
    /**
279
     * {@inheritdoc}
@@ 301-316 (lines=16) @@
298
    /**
299
     * {@inheritdoc}
300
     */
301
    public function addFieldDefinition($typeId, $status, FieldDefinition $struct)
302
    {
303
        $this->logger->logCall(__METHOD__, array('type' => $typeId, 'status' => $status, 'struct' => $struct));
304
        $return = $this->persistenceHandler->contentTypeHandler()->addFieldDefinition(
305
            $typeId,
306
            $status,
307
            $struct
308
        );
309
310
        if ($status === Type::STATUS_DEFINED) {
311
            $this->cache->clear('contentType', $typeId);
312
            $this->cache->clear('searchableFieldMap');
313
        }
314
315
        return $return;
316
    }
317
318
    /**
319
     * {@inheritdoc}

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

@@ 202-210 (lines=9) @@
199
    /**
200
     * {@inheritdoc}
201
     */
202
    public function setContentState($contentId, $groupId, $stateId)
203
    {
204
        $this->logger->logCall(__METHOD__, array('contentId' => $contentId, 'groupId' => $groupId, 'stateId' => $stateId));
205
        $return = $this->persistenceHandler->objectStateHandler()->setContentState($contentId, $groupId, $stateId);
206
207
        $this->cache->clear('objectstate', 'byContent', $contentId, $groupId);
208
209
        return $return;
210
    }
211
212
    /**
213
     * {@inheritdoc}

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

@@ 36-45 (lines=10) @@
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function update($id, $name, $identifier)
37
    {
38
        $this->logger->logCall(__METHOD__, array('section' => $id, 'name' => $name, 'identifier' => $identifier));
39
        $this->cache
40
            ->getItem('section', $id)
41
            ->set($section = $this->persistenceHandler->sectionHandler()->update($id, $name, $identifier))
42
            ->save();
43
44
        return $section;
45
    }
46
47
    /**
48
     * {@inheritdoc}

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

@@ 350-373 (lines=24) @@
347
    /**
348
     * {@inheritdoc}
349
     */
350
    public function locationSwapped($location1Id, $location1ParentId, $location2Id, $location2ParentId)
351
    {
352
        $this->logger->logCall(
353
            __METHOD__,
354
            [
355
                'location1Id' => $location1Id,
356
                'location1ParentId' => $location1ParentId,
357
                'location2Id' => $location2Id,
358
                'location2ParentId' => $location2ParentId,
359
            ]
360
        );
361
362
        $return = $this->persistenceHandler->urlAliasHandler()->locationSwapped(
363
            $location1Id,
364
            $location1ParentId,
365
            $location2Id,
366
            $location2ParentId
367
        );
368
369
        $this->clearLocation($location1Id);
370
        $this->clearLocation($location2Id);
371
372
        return $return;
373
    }
374
375
    /**
376
     * {@inheritdoc}