eZPublishCommunityProject  2012.12
eZ\Publish\Core\REST\Client\ObjectStateService Class Reference

ObjectStateService service. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Client\ObjectStateService:
+ Collaboration diagram for eZ\Publish\Core\REST\Client\ObjectStateService:

Public Member Functions

 __construct (HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, UrlHandler $urlHandler)
 
 createObjectState (ObjectStateGroup $objectStateGroup, ObjectStateCreateStruct $objectStateCreateStruct)
 Creates a new object state in the given group. More...
 
 createObjectStateGroup (ObjectStateGroupCreateStruct $objectStateGroupCreateStruct)
 Creates a new object state group. More...
 
 deleteObjectState (ObjectState $objectState)
 Deletes a object state. More...
 
 deleteObjectStateGroup (ObjectStateGroup $objectStateGroup)
 Deletes a object state group including all states and links to content. More...
 
 getContentCount (ObjectState $objectState)
 Returns the number of objects which are in this state. More...
 
 getContentState (ContentInfo $contentInfo, ObjectStateGroup $objectStateGroup)
 Gets the object-state of object identified by $contentId. More...
 
 loadObjectState ($stateId)
 Loads an object state. More...
 
 loadObjectStateGroup ($objectStateGroupId)
 Loads a object state group. More...
 
 loadObjectStateGroups ($offset=0, $limit=-1)
 Loads all object state groups. More...
 
 loadObjectStates (ObjectStateGroup $objectStateGroup)
 This method returns the ordered list of object states of a group. More...
 
 newObjectStateCreateStruct ($identifier)
 Instantiates a new Object State Create Struct and sets $identifier in it. More...
 
 newObjectStateGroupCreateStruct ($identifier)
 Instantiates a new Object State Group Create Struct and sets $identified in it. More...
 
 newObjectStateGroupUpdateStruct ()
 Instantiates a new Object State Group Update Struct. More...
 
 newObjectStateUpdateStruct ()
 Instantiates a new Object State Update Struct. More...
 
 setContentState (ContentInfo $contentInfo, ObjectStateGroup $objectStateGroup, ObjectState $objectState)
 Sets the object-state of a state group to $state for the given content. More...
 
 setPriorityOfObjectState (ObjectState $objectState, $priority)
 Changes the priority of the state. More...
 
 setSession ($id)
 Set session ID. More...
 
 updateObjectState (ObjectState $objectState, ObjectStateUpdateStruct $objectStateUpdateStruct)
 Updates an object state. More...
 
 updateObjectStateGroup (ObjectStateGroup $objectStateGroup, ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct)
 Updates an object state group. More...
 

Private Attributes

 $client
 
 $inputDispatcher
 
 $outputVisitor
 
 $urlHandler
 

Detailed Description

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Client\ObjectStateService::__construct ( HttpClient  $client,
Dispatcher  $inputDispatcher,
Visitor  $outputVisitor,
UrlHandler  $urlHandler 
)
Parameters
\eZ\Publish\Core\REST\Client\HttpClient$client
\eZ\Publish\Core\REST\Common\Input\Dispatcher$inputDispatcher
\eZ\Publish\Core\REST\Common\Output\Visitor$outputVisitor
\eZ\Publish\Core\REST\Common\UrlHandler$urlHandler

Member Function Documentation

eZ\Publish\Core\REST\Client\ObjectStateService::createObjectState ( ObjectStateGroup  $objectStateGroup,
ObjectStateCreateStruct  $objectStateCreateStruct 
)

Creates a new object state in the given group.

Note: in current kernel: If it is the first state all content objects will set to this state.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to create an object state
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the object state with provided identifier already exists in the same group
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup$objectStateGroup
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct$objectStateCreateStruct
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::createObjectStateGroup ( ObjectStateGroupCreateStruct  $objectStateGroupCreateStruct)

Creates a new object state group.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to create an object state group
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the object state group with provided identifier already exists
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct$objectStateGroupCreateStruct
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::deleteObjectState ( ObjectState  $objectState)

Deletes a object state.

The state of the content objects is reset to the first object state in the group.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to delete an object state
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectState$objectState

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::deleteObjectStateGroup ( ObjectStateGroup  $objectStateGroup)

Deletes a object state group including all states and links to content.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to delete an object state group
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup$objectStateGroup

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::getContentCount ( ObjectState  $objectState)

Returns the number of objects which are in this state.

Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectState$objectState
Returns
int

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::getContentState ( ContentInfo  $contentInfo,
ObjectStateGroup  $objectStateGroup 
)

Gets the object-state of object identified by $contentId.

The $state is the id of the state within one group.

Parameters
\eZ\Publish\API\Repository\Values\Content\ContentInfo$contentInfo
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup$objectStateGroup
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::loadObjectState (   $stateId)

Loads an object state.

Parameters
mixed$stateId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif the state was not found
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::loadObjectStateGroup (   $objectStateGroupId)

Loads a object state group.

Parameters
mixed$objectStateGroupId
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif the group was not found
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::loadObjectStateGroups (   $offset = 0,
  $limit = -1 
)

Loads all object state groups.

Parameters
int$offset
int$limit
Todo:
Implement offset & limit
Returns
[]

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::loadObjectStates ( ObjectStateGroup  $objectStateGroup)

This method returns the ordered list of object states of a group.

Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup$objectStateGroup
Returns
[]

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::newObjectStateCreateStruct (   $identifier)

Instantiates a new Object State Create Struct and sets $identifier in it.

Parameters
string$identifier
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::newObjectStateGroupCreateStruct (   $identifier)

Instantiates a new Object State Group Create Struct and sets $identified in it.

Parameters
string$identifier
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::newObjectStateGroupUpdateStruct ( )

Instantiates a new Object State Group Update Struct.

Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::newObjectStateUpdateStruct ( )

Instantiates a new Object State Update Struct.

Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::setContentState ( ContentInfo  $contentInfo,
ObjectStateGroup  $objectStateGroup,
ObjectState  $objectState 
)

Sets the object-state of a state group to $state for the given content.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the object state does not belong to the given group
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to change the object state
Parameters
\eZ\Publish\API\Repository\Values\Content\ContentInfo$contentInfo
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup$objectStateGroup
\eZ\Publish\API\Repository\Values\ObjectState\ObjectState$objectState

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::setPriorityOfObjectState ( ObjectState  $objectState,
  $priority 
)

Changes the priority of the state.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to change priority on an object state
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectState$objectState
int$priority

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::setSession (   $id)

Set session ID.

Only for testing

Parameters
mixed$id

Implements eZ\Publish\Core\REST\Client\Sessionable.

eZ\Publish\Core\REST\Client\ObjectStateService::updateObjectState ( ObjectState  $objectState,
ObjectStateUpdateStruct  $objectStateUpdateStruct 
)

Updates an object state.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to update an object state
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the object state with provided identifier already exists in the same group
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectState$objectState
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct$objectStateUpdateStruct
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

eZ\Publish\Core\REST\Client\ObjectStateService::updateObjectStateGroup ( ObjectStateGroup  $objectStateGroup,
ObjectStateGroupUpdateStruct  $objectStateGroupUpdateStruct 
)

Updates an object state group.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to update an object state group
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the object state group with provided identifier already exists
Parameters
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup$objectStateGroup
\eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct$objectStateGroupUpdateStruct
Returns

Implements eZ\Publish\API\Repository\ObjectStateService.

Member Data Documentation

eZ\Publish\Core\REST\Client\ObjectStateService::$client
private
eZ\Publish\Core\REST\Client\ObjectStateService::$inputDispatcher
private
eZ\Publish\Core\REST\Client\ObjectStateService::$outputVisitor
private
eZ\Publish\Core\REST\Client\ObjectStateService::$urlHandler
private

The documentation for this class was generated from the following file: