Class

eZ\Publish\Core\Persistence\Legacy\Content\ObjectState\Handler

class Handler implements Handler

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

Methods

__construct(Gateway $objectStateGateway, Mapper $objectStateMapper)

Creates a new ObjectState Handler.

Group createGroup(InputStruct $input)

Creates a new object state group.

Group loadGroup(mixed $groupId)

Loads an object state group.

Group loadGroupByIdentifier(string $identifier)

Loads a object state group by identifier.

Group[] loadAllGroups(int $offset, int $limit = -1)

Loads all object state groups.

ObjectState[] loadObjectStates(mixed $groupId)

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

Group updateGroup(mixed $groupId, InputStruct $input)

Updates an object state group.

deleteGroup(mixed $groupId)

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

ObjectState create(mixed $groupId, InputStruct $input)

Creates a new object state in the given group.

ObjectState load(mixed $stateId)

Loads an object state.

ObjectState loadByIdentifier(string $identifier, mixed $groupId)

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

ObjectState update(mixed $stateId, InputStruct $input)

Updates an object state.

setPriority(mixed $stateId, int $priority)

Changes the priority of the state.

delete(mixed $stateId)

Deletes a object state.

bool setContentState(mixed $contentId, mixed $groupId, mixed $stateId)

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

ObjectState getContentState(mixed $contentId, mixed $stateGroupId)

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

int getContentCount(mixed $stateId)

Returns the number of objects which are in this state.

Details

at line 40
public __construct(Gateway $objectStateGateway, Mapper $objectStateMapper)

Creates a new ObjectState Handler.

Parameters

Gateway $objectStateGateway
Mapper $objectStateMapper

at line 53
public Group createGroup(InputStruct $input)

Creates a new object state group.

Parameters

InputStruct $input

Return Value

Group

at line 70
public Group loadGroup(mixed $groupId)

Loads an object state group.

Parameters

mixed $groupId

Return Value

Group

Exceptions

NotFoundException if the group was not found

at line 90
public Group loadGroupByIdentifier(string $identifier)

Loads a object state group by identifier.

Parameters

string $identifier

Return Value

Group

Exceptions

NotFoundException if the group was not found

at line 109
public Group[] loadAllGroups(int $offset, int $limit = -1)

Loads all object state groups.

Parameters

int $offset
int $limit

Return Value

Group[]

at line 123
public ObjectState[] loadObjectStates(mixed $groupId)

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

Parameters

mixed $groupId

Return Value

ObjectState[]

at line 138
public Group updateGroup(mixed $groupId, InputStruct $input)

Updates an object state group.

Parameters

mixed $groupId
InputStruct $input

Return Value

Group

at line 153
public deleteGroup(mixed $groupId)

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

Parameters

mixed $groupId

at line 175
public ObjectState create(mixed $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
InputStruct $input

Return Value

ObjectState

at line 192
public ObjectState load(mixed $stateId)

Loads an object state.

Parameters

mixed $stateId

Return Value

ObjectState

Exceptions

NotFoundException if the state was not found

at line 213
public ObjectState loadByIdentifier(string $identifier, mixed $groupId)

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

Parameters

string $identifier
mixed $groupId

Return Value

ObjectState

Exceptions

NotFoundException if the state was not found

at line 232
public ObjectState update(mixed $stateId, InputStruct $input)

Updates an object state.

Parameters

mixed $stateId
InputStruct $input

Return Value

ObjectState

at line 248
public setPriority(mixed $stateId, int $priority)

Changes the priority of the state.

Parameters

mixed $stateId
int $priority

at line 278
public delete(mixed $stateId)

Deletes a object state.

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

Parameters

mixed $stateId

Exceptions

NotFoundException If state with $stateId doesn't exist

at line 313
public bool setContentState(mixed $contentId, mixed $groupId, mixed $stateId)

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

Parameters

mixed $contentId
mixed $groupId
mixed $stateId

Return Value

bool

at line 332
public ObjectState getContentState(mixed $contentId, mixed $stateGroupId)

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

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

Parameters

mixed $contentId
mixed $stateGroupId

Return Value

ObjectState

Exceptions

NotFoundException If no state is found

at line 350
public int getContentCount(mixed $stateId)

Returns the number of objects which are in this state.

Parameters

mixed $stateId

Return Value

int