eZ\Publish\Core\SignalSlot\ObjectStateService::setContentState PHP Method

setContentState() public method

Sets the object-state of a state group to $state for the given content.
public setContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState )
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
    public function setContentState(ContentInfo $contentInfo, ObjectStateGroup $objectStateGroup, ObjectState $objectState)
    {
        $returnValue = $this->service->setContentState($contentInfo, $objectStateGroup, $objectState);
        $this->signalDispatcher->emit(new SetContentStateSignal(array('contentId' => $contentInfo->id, 'objectStateGroupId' => $objectStateGroup->id, 'objectStateId' => $objectState->id)));
        return $returnValue;
    }