/** * Returns the number of objects which are in this state * * @param \eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState * * @return int */ public function getContentCount(ObjectState $objectState) { $groupId = $objectState->getObjectStateGroup()->id; $contentCount = 0; foreach ($this->objectStateMap as $objectId => $stateMap) { if (isset($stateMap[$groupId]) && $stateMap[$groupId] == $objectState->id) { ++$contentCount; } } return $contentCount; }