public function loadObjectStates($groupId)
{
$cache = $this->cache->getItem('objectstate', 'byGroup', $groupId);
$objectStateIds = $cache->get();
if ($cache->isMiss()) {
$this->logger->logCall(__METHOD__, array('groupId' => $groupId));
$objectStates = $this->persistenceHandler->objectStateHandler()->loadObjectStates($groupId);
$objectStateIds = array();
foreach ($objectStates as $objectState) {
$objectStateIds[] = $objectState->id;
}
$cache->set($objectStateIds)->save();
} else {
$objectStates = array();
foreach ($objectStateIds as $stateId) {
$objectStates[] = $this->load($stateId);
}
}
return $objectStates;
}