Skip to content

Commit

Permalink
[Cache] Cleanup BC code from 6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Oct 30, 2017
1 parent 0c27115 commit 1cff2fc
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions eZ/Publish/Core/Persistence/Cache/ObjectStateHandler.php
Expand Up @@ -67,19 +67,9 @@ public function loadAllGroups($offset = 0, $limit = -1)
$this->logger->logCall(__METHOD__, array('offset' => $offset, 'limit' => $limit));
$stateGroups = $this->persistenceHandler->objectStateHandler()->loadAllGroups(0, -1);
$cache->set($stateGroups)->save();
$stateGroups = array_slice($stateGroups, $offset, $limit > -1 ?: null);
} else {
$stateGroups = array_slice($stateGroups, $offset, $limit > -1 ?: null);
// BC for updates to 6.7LTS installs where cache contains ID's and not objects
// @todo Remove in later branches
foreach ($stateGroups as $key => $stateGroup) {
if (is_numeric($stateGroup)) {
$stateGroups[$key] = $this->loadGroup($stateGroup);
}
}
}

return $stateGroups;
return array_slice($stateGroups, $offset, $limit > -1 ?: null);
}

/**
Expand All @@ -93,14 +83,6 @@ public function loadObjectStates($groupId)
$this->logger->logCall(__METHOD__, array('groupId' => $groupId));
$objectStates = $this->persistenceHandler->objectStateHandler()->loadObjectStates($groupId);
$cache->set($objectStates)->save();
} else {
// BC for updates to 6.7LTS installs where cache contains ID's and not objects
// @todo Remove in later branches
foreach ($objectStates as $key => $state) {
if (is_numeric($state)) {
$objectStates[$key] = $this->load($state);
}
}
}

return $objectStates;
Expand Down

0 comments on commit 1cff2fc

Please sign in to comment.