Interface

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

interface Handler

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

Methods

Group createGroup(InputStruct $input)

Creates a new object state group.

Group loadGroup(mixed $groupId)

Loads a 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 23
public Group createGroup(InputStruct $input)

Creates a new object state group.

Parameters

InputStruct $input

Return Value

Group

at line 34
public Group loadGroup(mixed $groupId)

Loads a object state group.

Parameters

mixed $groupId

Return Value

Group

Exceptions

NotFoundException if the group was not found

at line 45
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 55
public Group[] loadAllGroups(int $offset, int $limit = -1)

Loads all object state groups.

Parameters

int $offset
int $limit

Return Value

Group[]

at line 64
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 74
public Group updateGroup(mixed $groupId, InputStruct $input)

Updates an object state group.

Parameters

mixed $groupId
InputStruct $input

Return Value

Group

at line 81
public deleteGroup(mixed $groupId)

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

Parameters

mixed $groupId

at line 94
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 105
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 117
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 127
public ObjectState update(mixed $stateId, InputStruct $input)

Updates an object state.

Parameters

mixed $stateId
InputStruct $input

Return Value

ObjectState

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

Changes the priority of the state.

Parameters

mixed $stateId
int $priority

at line 143
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

at line 154
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 166
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

at line 175
public int getContentCount(mixed $stateId)

Returns the number of objects which are in this state.

Parameters

mixed $stateId

Return Value

int