Code Duplication    Length = 7-10 lines in 11 locations

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

@@ 82-91 (lines=10) @@
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function loadUserBookmarks(int $userId, int $offset = 0, int $limit = -1): array
83
    {
84
        $this->logger->logCall(__METHOD__, [
85
            'userId' => $userId,
86
            'offset' => $offset,
87
            'limit' => $limit,
88
        ]);
89
90
        return $this->persistenceHandler->bookmarkHandler()->loadUserBookmarks($userId, $offset, $limit);
91
    }
92
93
    /**
94
     * {@inheritdoc}

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

@@ 154-163 (lines=10) @@
151
    /**
152
     * {@inheritdoc}
153
     */
154
    public function loadUserNotifications(int $userId, int $offset, int $limit): array
155
    {
156
        $this->logger->logCall(__METHOD__, [
157
            'ownerId' => $userId,
158
            'offset' => $offset,
159
            'limit' => $limit,
160
        ]);
161
162
        return $this->persistenceHandler->notificationHandler()->loadUserNotifications($userId, $offset, $limit);
163
    }
164
}
165

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

@@ 94-103 (lines=10) @@
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function loadUserPreferences(int $userId, int $offset, int $limit): array
95
    {
96
        $this->logger->logCall(__METHOD__, [
97
            'userId' => $userId,
98
            'offset' => $offset,
99
            'limit' => $limit,
100
        ]);
101
102
        return $this->persistenceHandler->userPreferenceHandler()->loadUserPreferences($userId, $offset, $limit);
103
    }
104
}
105

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

@@ 50-57 (lines=8) @@
47
        return $this->getMultipleCacheItems(
48
            $locationIds,
49
            'ez-location-',
50
            function (array $cacheMissIds) use ($translations, $useAlwaysAvailable) {
51
                $this->logger->logCall(
52
                    __CLASS__ . '::loadList',
53
                    ['location' => $cacheMissIds, 'translations' => $translations, 'always-available' => $useAlwaysAvailable]
54
                );
55
56
                return $this->persistenceHandler->locationHandler()->loadList($cacheMissIds, $translations, $useAlwaysAvailable);
57
            },
58
            function (Location $location) {
59
                return $this->getCacheTags($location);
60
            },
@@ 171-180 (lines=10) @@
168
    /**
169
     * {@inheritdoc}
170
     */
171
    public function copySubtree($sourceId, $destinationParentId, $newOwnerId = null)
172
    {
173
        $this->logger->logCall(__METHOD__, array(
174
            'source' => $sourceId,
175
            'destination' => $destinationParentId,
176
            'newOwner' => $newOwnerId,
177
        ));
178
179
        return $this->persistenceHandler->locationHandler()->copySubtree($sourceId, $destinationParentId, $newOwnerId);
180
    }
181
182
    /**
183
     * {@inheritdoc}

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

@@ 156-165 (lines=10) @@
153
    /**
154
     * {@inheritdoc}
155
     */
156
    public function delete($id)
157
    {
158
        $this->logger->logCall(__METHOD__, array('language' => $id));
159
        $return = $this->persistenceHandler->contentLanguageHandler()->delete($id);
160
161
        // As we don't have locale we clear cache by tag invalidation
162
        $this->invalidateCache(['language-' . $id]);
163
164
        return $return;
165
    }
166
}
167

eZ/Publish/Core/Persistence/Cache/UserHandler.php 5 locations

@@ 189-198 (lines=10) @@
186
    /**
187
     * {@inheritdoc}
188
     */
189
    public function update(User $user)
190
    {
191
        $this->logger->logCall(__METHOD__, array('struct' => $user));
192
        $return = $this->persistenceHandler->userHandler()->update($user);
193
194
        // Clear corresponding content cache as update of the User changes it's external data
195
        $this->invalidateCache(['content-fields-' . $user->id, 'user-' . $user->id]);
196
197
        return $return;
198
    }
199
200
    /**
201
     * {@inheritdoc}
@@ 399-405 (lines=7) @@
396
    /**
397
     * {@inheritdoc}
398
     */
399
    public function updateRole(RoleUpdateStruct $struct)
400
    {
401
        $this->logger->logCall(__METHOD__, array('struct' => $struct));
402
        $this->persistenceHandler->userHandler()->updateRole($struct);
403
404
        $this->invalidateCache(['role-' . $struct->id]);
405
    }
406
407
    /**
408
     * {@inheritdoc}
@@ 466-474 (lines=9) @@
463
    /**
464
     * {@inheritdoc}
465
     */
466
    public function updatePolicy(Policy $policy)
467
    {
468
        $this->logger->logCall(__METHOD__, array('struct' => $policy));
469
        $return = $this->persistenceHandler->userHandler()->updatePolicy($policy);
470
471
        $this->invalidateCache(['policy-' . $policy->id, 'role-' . $policy->roleId]);
472
473
        return $return;
474
    }
475
476
    /**
477
     * {@inheritdoc}
@@ 479-485 (lines=7) @@
476
    /**
477
     * {@inheritdoc}
478
     */
479
    public function deletePolicy($policyId, $roleId)
480
    {
481
        $this->logger->logCall(__METHOD__, array('policy' => $policyId));
482
        $this->persistenceHandler->userHandler()->deletePolicy($policyId, $roleId);
483
484
        $this->invalidateCache(['policy-' . $policyId, 'role-' . $roleId]);
485
    }
486
487
    /**
488
     * {@inheritdoc}
@@ 532-540 (lines=9) @@
529
    /**
530
     * {@inheritdoc}
531
     */
532
    public function removeRoleAssignment($roleAssignmentId)
533
    {
534
        $this->logger->logCall(__METHOD__, array('assignment' => $roleAssignmentId));
535
        $return = $this->persistenceHandler->userHandler()->removeRoleAssignment($roleAssignmentId);
536
537
        $this->invalidateCache(['role-assignment-' . $roleAssignmentId]);
538
539
        return $return;
540
    }
541
}
542