Copied!

ObjectStateService

ObjectStateService.php : 22

ObjectStateService service.

Tags
Example

Examples/objectstates.php tbd.

Methods

publiccreateObjectState()

ObjectStateService.php : 114

Creates a new object state in the given group.

public createObjectState(ObjectStateGroup $objectStateGroup, ObjectStateCreateStruct $objectStateCreateStruct) : ObjectState

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

Parameters

Name Type Default value Description
$objectStateGroup ObjectStateGroup - -
$objectStateCreateStruct ObjectStateCreateStruct - -

Return values

ObjectState

Tags
Throws
UnauthorizedException

if the user is not allowed to create an object state

Throws
InvalidArgumentException

if the object state with provided identifier already exists in the same group

publiccreateObjectStateGroup()

ObjectStateService.php : 34

Creates a new object state group.

public createObjectStateGroup(ObjectStateGroupCreateStruct $objectStateGroupCreateStruct) : ObjectStateGroup

Parameters

Name Type Default value Description
$objectStateGroupCreateStruct ObjectStateGroupCreateStruct - -

Return values

ObjectStateGroup

Tags
Throws
UnauthorizedException

if the user is not allowed to create an object state group

Throws
InvalidArgumentException

if the object state group with provided identifier already exists

publicdeleteObjectState()

ObjectStateService.php : 168

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

public deleteObjectState(ObjectState $objectState) : void

Parameters

Name Type Default value Description
$objectState ObjectState - -
Tags
Throws
UnauthorizedException

if the user is not allowed to delete an object state

publicdeleteObjectStateGroup()

ObjectStateService.php : 98

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

public deleteObjectStateGroup(ObjectStateGroup $objectStateGroup) : void

Parameters

Name Type Default value Description
$objectStateGroup ObjectStateGroup - -
Tags
Throws
UnauthorizedException

if the user is not allowed to delete an object state group

publicgetContentCount()

ObjectStateService.php : 201

Returns the number of objects which are in this state.

public getContentCount(ObjectState $objectState) : int

Parameters

Name Type Default value Description
$objectState ObjectState - -

Return values

int

publicgetContentState()

ObjectStateService.php : 192

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

public getContentState(ContentInfo $contentInfo, ObjectStateGroup $objectStateGroup) : ObjectState

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

Parameters

Name Type Default value Description
$contentInfo ContentInfo - -
$objectStateGroup ObjectStateGroup - -

Return values

ObjectState

publicloadObjectState()

ObjectStateService.php : 126

Loads an object state.

public loadObjectState(mixed $stateId[, array<string|int, string> $prioritizedLanguages = [] ]) : ObjectState

Parameters

Name Type Default value Description
$stateId mixed - -
$prioritizedLanguages array<string|int, string> []

Used as prioritized language code on translated properties of returned object.

Return values

ObjectState

Tags
Throws
NotFoundException

if the state was not found

publicloadObjectStateByIdentifier()

ObjectStateService.php : 135

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

public loadObjectStateByIdentifier(ObjectStateGroup $objectStateGroup, string $objectStateIdentifier[, array<string|int, string> $prioritizedLanguages = [] ]) : ObjectState

Parameters

Name Type Default value Description
$objectStateGroup ObjectStateGroup - -
$objectStateIdentifier string - -
$prioritizedLanguages array<string|int, string> []

Used as prioritized language code on translated properties of returned object.

Return values

ObjectState

Tags
Throws
NotFoundException

if the state was not found

publicloadObjectStateGroup()

ObjectStateService.php : 46

Loads a object state group.

public loadObjectStateGroup(mixed $objectStateGroupId[, array<string|int, string> $prioritizedLanguages = [] ]) : ObjectStateGroup

Parameters

Name Type Default value Description
$objectStateGroupId mixed - -
$prioritizedLanguages array<string|int, string> []

Used as prioritized language code on translated properties of returned object.

Return values

ObjectStateGroup

Tags
Throws
NotFoundException

if the group was not found

publicloadObjectStateGroupByIdentifier()

ObjectStateService.php : 55

Loads a object state group by identifier.

public loadObjectStateGroupByIdentifier(string $objectStateGroupIdentifier[, array<string|int, string> $prioritizedLanguages = [] ]) : ObjectStateGroup

Parameters

Name Type Default value Description
$objectStateGroupIdentifier string - -
$prioritizedLanguages array<string|int, string> []

Used as prioritized language code on translated properties of returned object.

Return values

ObjectStateGroup

Tags
Throws
NotFoundException

if the group was not found

publicloadObjectStateGroups()

ObjectStateService.php : 66

Loads all object state groups.

public loadObjectStateGroups([int $offset = 0 ][, int $limit = -1 ][, array<string|int, string> $prioritizedLanguages = [] ]) : array<string|int, ObjectStateGroup>

Parameters

Name Type Default value Description
$offset int 0 -
$limit int -1 -
$prioritizedLanguages array<string|int, string> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, ObjectStateGroup>

publicloadObjectStates()

ObjectStateService.php : 76

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

public loadObjectStates(ObjectStateGroup $objectStateGroup[, array<string|int, string> $prioritizedLanguages = [] ]) : array<string|int, ObjectState>

Parameters

Name Type Default value Description
$objectStateGroup ObjectStateGroup - -
$prioritizedLanguages array<string|int, string> []

Used as prioritized language code on translated properties of returned object.

Return values

array<string|int, ObjectState>

publicnewObjectStateCreateStruct()

ObjectStateService.php : 226

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

public newObjectStateCreateStruct(string $identifier) : ObjectStateCreateStruct

Parameters

Name Type Default value Description
$identifier string - -

Return values

ObjectStateCreateStruct

publicnewObjectStateGroupCreateStruct()

ObjectStateService.php : 210

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

public newObjectStateGroupCreateStruct(string $identifier) : ObjectStateGroupCreateStruct

Parameters

Name Type Default value Description
$identifier string - -

Return values

ObjectStateGroupCreateStruct

publicnewObjectStateGroupUpdateStruct()

ObjectStateService.php : 217

Instantiates a new Object State Group Update Struct.

public newObjectStateGroupUpdateStruct() : ObjectStateGroupUpdateStruct

Return values

ObjectStateGroupUpdateStruct

publicnewObjectStateUpdateStruct()

ObjectStateService.php : 233

Instantiates a new Object State Update Struct.

public newObjectStateUpdateStruct() : ObjectStateUpdateStruct

Return values

ObjectStateUpdateStruct

publicsetContentState()

ObjectStateService.php : 180

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

public setContentState(ContentInfo $contentInfo, ObjectStateGroup $objectStateGroup, ObjectState $objectState) : void

Parameters

Name Type Default value Description
$contentInfo ContentInfo - -
$objectStateGroup ObjectStateGroup - -
$objectState ObjectState - -
Tags
Throws
InvalidArgumentException

if the object state does not belong to the given group

Throws
UnauthorizedException

if the user is not allowed to change the object state

publicsetPriorityOfObjectState()

ObjectStateService.php : 158

Changes the priority of the state.

public setPriorityOfObjectState(ObjectState $objectState, int $priority) : void

Parameters

Name Type Default value Description
$objectState ObjectState - -
$priority int - -
Tags
Throws
UnauthorizedException

if the user is not allowed to change priority on an object state

publicupdateObjectState()

ObjectStateService.php : 148

Updates an object state.

public updateObjectState(ObjectState $objectState, ObjectStateUpdateStruct $objectStateUpdateStruct) : ObjectState

Parameters

Name Type Default value Description
$objectState ObjectState - -
$objectStateUpdateStruct ObjectStateUpdateStruct - -

Return values

ObjectState

Tags
Throws
InvalidArgumentException

if the object state with provided identifier already exists in the same group

Throws
UnauthorizedException

if the user is not allowed to update an object state

publicupdateObjectStateGroup()

ObjectStateService.php : 89

Updates an object state group.

public updateObjectStateGroup(ObjectStateGroup $objectStateGroup, ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct) : ObjectStateGroup

Parameters

Name Type Default value Description
$objectStateGroup ObjectStateGroup - -
$objectStateGroupUpdateStruct ObjectStateGroupUpdateStruct - -

Return values

ObjectStateGroup

Tags
Throws
UnauthorizedException

if the user is not allowed to update an object state group

Throws
InvalidArgumentException

if the object state group with provided identifier already exists