eZ\Publish\Core\REST\Server\Controller\ObjectState::getObjectStatesForContent PHP Метод

getObjectStatesForContent() публичный Метод

Returns the object states of content.
public getObjectStatesForContent ( $contentId ) : ContentObjectStates
$contentId
Результат eZ\Publish\Core\REST\Common\Values\ContentObjectStates
    public function getObjectStatesForContent($contentId)
    {
        $groups = $this->objectStateService->loadObjectStateGroups();
        $contentInfo = $this->contentService->loadContentInfo($contentId);
        $contentObjectStates = array();
        foreach ($groups as $group) {
            try {
                $state = $this->objectStateService->getContentState($contentInfo, $group);
                $contentObjectStates[] = new RestObjectState($state, $group->id);
            } catch (NotFoundException $e) {
                // Do nothing
            }
        }
        return new ContentObjectStates($contentObjectStates);
    }