eZPublishCommunityProject  2013.6
eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler Class Reference

The Object State Handler class provides managing of object states and groups. More...

+ Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler:

Public Member Functions

 __construct (Gateway $objectStateGateway, Mapper $objectStateMapper)
 Creates a new ObjectState Handler. More...
 
 create ($groupId, InputStruct $input)
 Creates a new object state in the given group. More...
 
 createGroup (InputStruct $input)
 Creates a new object state group. More...
 
 delete ($stateId)
 Deletes a object state. More...
 
 deleteGroup ($groupId)
 Deletes a object state group including all states and links to content. More...
 
 getContentCount ($stateId)
 Returns the number of objects which are in this state. More...
 
 getContentState ($contentId, $stateGroupId)
 Gets the object-state of object identified by $contentId. More...
 
 load ($stateId)
 Loads an object state. More...
 
 loadAllGroups ($offset=0, $limit=-1)
 Loads all object state groups. More...
 
 loadByIdentifier ($identifier, $groupId)
 Loads an object state by identifier and group it belongs to. More...
 
 loadGroup ($groupId)
 Loads an object state group. More...
 
 loadGroupByIdentifier ($identifier)
 Loads a object state group by identifier. More...
 
 loadObjectStates ($groupId)
 This method returns the ordered list of object states of a group. More...
 
 setContentState ($contentId, $groupId, $stateId)
 Sets the object-state of a state group to $stateId for the given content. More...
 
 setPriority ($stateId, $priority)
 Changes the priority of the state. More...
 
 update ($stateId, InputStruct $input)
 Updates an object state. More...
 
 updateGroup ($groupId, InputStruct $input)
 Updates an object state group. More...
 

Protected Attributes

 $objectStateGateway
 
 $objectStateMapper
 

Detailed Description

The Object State Handler class provides managing of object states and groups.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::__construct ( Gateway  $objectStateGateway,
Mapper  $objectStateMapper 
)

Creates a new ObjectState Handler.

Parameters
\eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Gateway$objectStateGateway
\eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Mapper$objectStateMapper

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::create (   $groupId,
InputStruct  $input 
)

Creates a new object state in the given group.

The new state gets the last priority. Note: in current kernel: If it is the first state all content objects will set to this state.

Parameters
mixed$groupId
\eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct$input
Returns

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::createGroup ( InputStruct  $input)

Creates a new object state group.

Parameters
\eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct$input
Returns

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::delete (   $stateId)

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\NotFoundExceptionIf state with $stateId doesn't exist
Parameters
mixed$stateId

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::deleteGroup (   $groupId)

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

Parameters
mixed$groupId

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::getContentCount (   $stateId)

Returns the number of objects which are in this state.

Parameters
mixed$stateId
Returns
int

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::getContentState (   $contentId,
  $stateGroupId 
)

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

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

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionIf no state is found
Parameters
mixed$contentId
mixed$stateGroupId
Returns

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::load (   $stateId)

Loads an object state.

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

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler\delete(), eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler\setPriority(), and eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler\update().

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::loadAllGroups (   $offset = 0,
  $limit = -1 
)

Loads all object state groups.

Parameters
int$offset
int$limit
Returns
[]

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::loadByIdentifier (   $identifier,
  $groupId 
)

Loads an object state by identifier and group it belongs to.

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

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::loadGroup (   $groupId)

Loads an object state group.

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

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler\updateGroup().

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::loadGroupByIdentifier (   $identifier)

Loads a object state group by identifier.

Parameters
string$identifier
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif the group was not found
Returns

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::loadObjectStates (   $groupId)
eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::setContentState (   $contentId,
  $groupId,
  $stateId 
)

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

Parameters
mixed$contentId
mixed$groupId
mixed$stateId
Returns
boolean

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::setPriority (   $stateId,
  $priority 
)

Changes the priority of the state.

Parameters
mixed$stateId
int$priority

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::update (   $stateId,
InputStruct  $input 
)

Updates an object state.

Parameters
mixed$stateId
\eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct$input
Returns

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::updateGroup (   $groupId,
InputStruct  $input 
)

Updates an object state group.

Parameters
mixed$groupId
\eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct$input
Returns

Implements eZ\Publish\SPI\Persistence\Content\ObjectState\Handler.

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::$objectStateGateway
protected
eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler::$objectStateMapper
protected

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