PHP Class eZ\Publish\Core\REST\Client\ObjectStateService

Inheritance: implements eZ\Publish\API\Repository\ObjectStateService, implements eZ\Publish\Core\REST\Client\Sessionable
Show file Open project: ezsystems/ezpublish-kernel

Public Methods

Method Description
__construct ( eZ\Publish\Core\REST\Client\HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, eZ\Publish\Core\REST\Common\RequestParser $requestParser )
createObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct $objectStateCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Creates a new object state in the given group.
createObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct $objectStateGroupCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Creates a new object state group.
deleteObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) Deletes a object state. The state of the content objects is reset to the first object state in the group.
deleteObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) Deletes a object state group including all states and links to content.
getContentCount ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) : integer Returns the number of objects which are in this state.
getContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Gets the object-state of object identified by $contentId.
loadObjectState ( mixed $stateId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Loads an object state.
loadObjectStateGroup ( mixed $objectStateGroupId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Loads a object state group.
loadObjectStateGroups ( integer $offset, integer $limit ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup[] Loads all object state groups.
loadObjectStates ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState[] This method returns the ordered list of object states of a group.
newObjectStateCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct Instantiates a new Object State Create Struct and sets $identifier in it.
newObjectStateGroupCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct Instantiates a new Object State Group Create Struct and sets $identified in it.
newObjectStateGroupUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct Instantiates a new Object State Group Update Struct.
newObjectStateUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct Instantiates a new Object State Update Struct.
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 ) Sets the object-state of a state group to $state for the given content.
setPriorityOfObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, integer $priority ) Changes the priority of the state.
setSession ( mixed $id ) Set session ID.
updateObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct $objectStateUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Updates an object state.
updateObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Updates an object state group.

Method Details

__construct() public method

public __construct ( eZ\Publish\Core\REST\Client\HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, eZ\Publish\Core\REST\Common\RequestParser $requestParser )
$client eZ\Publish\Core\REST\Client\HttpClient
$inputDispatcher eZ\Publish\Core\REST\Common\Input\Dispatcher
$outputVisitor eZ\Publish\Core\REST\Common\Output\Visitor
$requestParser eZ\Publish\Core\REST\Common\RequestParser

createObjectState() public method

Note: in current kernel: If it is the first state all content objects will set to this state.
public createObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct $objectStateCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateCreateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

createObjectStateGroup() public method

Creates a new object state group.
public createObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct $objectStateGroupCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroupCreateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

deleteObjectState() public method

Deletes a object state. The state of the content objects is reset to the first object state in the group.
public deleteObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState )
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState

deleteObjectStateGroup() public method

Deletes a object state group including all states and links to content.
public deleteObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup )
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

getContentCount() public method

Returns the number of objects which are in this state.
public getContentCount ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) : integer
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
return integer

getContentState() public method

The $state is the id of the state within one group.
public getContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

loadObjectState() public method

Loads an object state.
public loadObjectState ( mixed $stateId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$stateId mixed
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

loadObjectStateGroup() public method

Loads a object state group.
public loadObjectStateGroup ( mixed $objectStateGroupId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroupId mixed
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

loadObjectStateGroups() public method

Loads all object state groups.
public loadObjectStateGroups ( integer $offset, integer $limit ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup[]
$offset integer
$limit integer
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup[]

loadObjectStates() public method

This method returns the ordered list of object states of a group.
public loadObjectStates ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState[]
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState[]

newObjectStateCreateStruct() public method

Instantiates a new Object State Create Struct and sets $identifier in it.
public newObjectStateCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct
$identifier string
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct

newObjectStateGroupCreateStruct() public method

Instantiates a new Object State Group Create Struct and sets $identified in it.
public newObjectStateGroupCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct
$identifier string
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct

newObjectStateGroupUpdateStruct() public method

Instantiates a new Object State Group Update Struct.
public newObjectStateGroupUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct

newObjectStateUpdateStruct() public method

Instantiates a new Object State Update Struct.
public newObjectStateUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct

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

setPriorityOfObjectState() public method

Changes the priority of the state.
public setPriorityOfObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, integer $priority )
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$priority integer

setSession() public method

Only for testing
public setSession ( mixed $id )
$id mixed

updateObjectState() public method

Updates an object state.
public updateObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct $objectStateUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$objectStateUpdateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

updateObjectStateGroup() public method

Updates an object state group.
public updateObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroupUpdateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup