/** * Gets the object-state of object identified by $contentId. * * The $state is the id of the state within one group. * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If no state is found * * @param mixed $contentId * @param mixed $stateGroupId * * @return \eZ\Publish\SPI\Persistence\Content\ObjectState */ public function getContentState($contentId, $stateGroupId) { $data = $this->objectStateGateway->loadObjectStateDataForContent($contentId, $stateGroupId); if (empty($data)) { throw new NotFoundException("ObjectState", array("groupId" => $stateGroupId)); } return $this->objectStateMapper->createObjectStateFromData($data); }