| @@ 66-70 (lines=5) @@ | ||
| 63 | $translationsKey = empty($translations) ? self::ALL_TRANSLATIONS_KEY : implode('|', $translations); |
|
| 64 | $cache = $this->cache->getItem('content', $contentId, $version, $translationsKey); |
|
| 65 | $content = $cache->get(); |
|
| 66 | if ($cache->isMiss()) { |
|
| 67 | $this->logger->logCall(__METHOD__, array('content' => $contentId, 'version' => $version, 'translations' => $translations)); |
|
| 68 | $content = $this->persistenceHandler->contentHandler()->load($contentId, $version, $translations); |
|
| 69 | $cache->set($content)->save(); |
|
| 70 | } |
|
| 71 | ||
| 72 | return $content; |
|
| 73 | } |
|
| @@ 128-131 (lines=4) @@ | ||
| 125 | // Get cache for published content types |
|
| 126 | $cache = $this->cache->getItem('contentType', $typeId); |
|
| 127 | $type = $cache->get(); |
|
| 128 | if ($cache->isMiss()) { |
|
| 129 | $this->logger->logCall(__METHOD__, array('type' => $typeId, 'status' => $status)); |
|
| 130 | $cache->set($type = $this->persistenceHandler->contentTypeHandler()->load($typeId, $status))->save(); |
|
| 131 | } |
|
| 132 | ||
| 133 | return $type; |
|
| 134 | } |
|
| @@ 126-130 (lines=5) @@ | ||
| 123 | if ($status === Role::STATUS_DEFINED) { |
|
| 124 | $cache = $this->cache->getItem('user', 'role', $roleId); |
|
| 125 | $role = $cache->get(); |
|
| 126 | if ($cache->isMiss()) { |
|
| 127 | $this->logger->logCall(__METHOD__, array('role' => $roleId)); |
|
| 128 | $role = $this->persistenceHandler->userHandler()->loadRole($roleId, $status); |
|
| 129 | $cache->set($role)->save(); |
|
| 130 | } |
|
| 131 | } else { |
|
| 132 | $role = $this->persistenceHandler->userHandler()->loadRole($roleId, $status); |
|
| 133 | } |
|
| @@ 199-206 (lines=8) @@ | ||
| 196 | $cache = $this->cache->getItem('user', 'role', 'assignments', 'byGroup', $groupId); |
|
| 197 | } |
|
| 198 | $assignments = $cache->get(); |
|
| 199 | if ($cache->isMiss()) { |
|
| 200 | $this->logger->logCall(__METHOD__, array('group' => $groupId, 'inherit' => $inherit)); |
|
| 201 | $assignments = $this->persistenceHandler->userHandler()->loadRoleAssignmentsByGroupId( |
|
| 202 | $groupId, |
|
| 203 | $inherit |
|
| 204 | ); |
|
| 205 | $cache->set($assignments)->save(); |
|
| 206 | } |
|
| 207 | ||
| 208 | return $assignments; |
|
| 209 | } |
|
| @@ 66-70 (lines=5) @@ | ||
| 63 | // Method caches all state groups in cache only uses offset / limit to slice the cached result |
|
| 64 | $cache = $this->cache->getItem('objectstategroup', 'all'); |
|
| 65 | $stateGroups = $cache->get(); |
|
| 66 | if ($cache->isMiss()) { |
|
| 67 | $this->logger->logCall(__METHOD__, array('offset' => $offset, 'limit' => $limit)); |
|
| 68 | $stateGroups = $this->persistenceHandler->objectStateHandler()->loadAllGroups(0, -1); |
|
| 69 | $cache->set($stateGroups)->save(); |
|
| 70 | } |
|
| 71 | ||
| 72 | return array_slice($stateGroups, $offset, $limit > -1 ?: null); |
|
| 73 | } |
|
| @@ 82-86 (lines=5) @@ | ||
| 79 | { |
|
| 80 | $cache = $this->cache->getItem('objectstate', 'byGroup', $groupId); |
|
| 81 | $objectStates = $cache->get(); |
|
| 82 | if ($cache->isMiss()) { |
|
| 83 | $this->logger->logCall(__METHOD__, array('groupId' => $groupId)); |
|
| 84 | $objectStates = $this->persistenceHandler->objectStateHandler()->loadObjectStates($groupId); |
|
| 85 | $cache->set($objectStates)->save(); |
|
| 86 | } |
|
| 87 | ||
| 88 | return $objectStates; |
|
| 89 | } |
|
| @@ 217-224 (lines=8) @@ | ||
| 214 | { |
|
| 215 | $cache = $this->cache->getItem('objectstate', 'byContent', $contentId, $stateGroupId); |
|
| 216 | $stateId = $cache->get(); |
|
| 217 | if ($cache->isMiss()) { |
|
| 218 | $this->logger->logCall(__METHOD__, array('contentId' => $contentId, 'stateGroupId' => $stateGroupId)); |
|
| 219 | ||
| 220 | $contentState = $this->persistenceHandler->objectStateHandler()->getContentState($contentId, $stateGroupId); |
|
| 221 | $cache->set($contentState->id)->save(); |
|
| 222 | ||
| 223 | return $contentState; |
|
| 224 | } |
|
| 225 | ||
| 226 | return $this->load($stateId); |
|
| 227 | } |
|