PHP Class eZ\Publish\Core\Repository\ObjectStateService

Inheritance: implements eZ\Publish\API\Repository\ObjectStateService
Datei anzeigen Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$objectStateHandler eZ\Publish\SPI\Persistence\Content\ObjectState\Handler
$repository eZ\Publish\API\Repository\Repository
$settings array

Public Methods

Method Description
__construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\SPI\Persistence\Content\ObjectState\Handler $objectStateHandler, array $settings = [] ) Setups service with reference to repository object that created it & corresponding handler.
createObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct $objectStateCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Creates a new object state in the given group.
createObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct $objectStateGroupCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Creates a new object state group.
deleteObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) Deletes a object state. The state of the content objects is reset to the first object state in the group.
deleteObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) Deletes a object state group including all states and links to content.
getContentCount ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) : integer Returns the number of objects which are in this state.
getContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Gets the object-state of object identified by $contentId.
loadObjectState ( mixed $stateId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Loads an object state.
loadObjectStateGroup ( mixed $objectStateGroupId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Loads a object state group.
loadObjectStateGroups ( integer $offset, integer $limit ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup[] Loads all object state groups.
loadObjectStates ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState[] This method returns the ordered list of object states of a group.
newObjectStateCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct Instantiates a new Object State Create Struct and sets $identifier in it.
newObjectStateGroupCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct Instantiates a new Object State Group Create Struct and sets $identified in it.
newObjectStateGroupUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct Instantiates a new Object State Group Update Struct.
newObjectStateUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct Instantiates a new Object State Update Struct.
setContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) Sets the object-state of a state group to $state for the given content.
setPriorityOfObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, integer $priority ) Changes the priority of the state.
updateObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct $objectStateUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Updates an object state.
updateObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Updates an object state group.

Protected Methods

Method Description
buildCreateInputStruct ( string $identifier, string $defaultLanguageCode, string[] $names, string[] $descriptions ) : eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct Validates input for creating object states/groups and builds the InputStruct object.
buildDomainObjectStateGroupObject ( eZ\Publish\SPI\Persistence\Content\ObjectState\Group $spiObjectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup Converts the object state group SPI value object to API value object.
buildDomainObjectStateObject ( eZ\Publish\SPI\Persistence\Content\ObjectState $spiObjectState, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup = null ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState Converts the object state SPI value object to API value object.
buildObjectStateGroupUpdateInputStruct ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, string $identifier, string $defaultLanguageCode, string[] $names, string[] $descriptions ) : eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct Validates input for updating object state groups and builds the InputStruct object.
buildObjectStateUpdateInputStruct ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, string $identifier, string $defaultLanguageCode, string[] $names, string[] $descriptions ) : eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct Validates input for updating object states and builds the InputStruct object.

Method Details

__construct() public method

Setups service with reference to repository object that created it & corresponding handler.
public __construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\SPI\Persistence\Content\ObjectState\Handler $objectStateHandler, array $settings = [] )
$repository eZ\Publish\API\Repository\Repository
$objectStateHandler eZ\Publish\SPI\Persistence\Content\ObjectState\Handler
$settings array

buildCreateInputStruct() protected method

Validates input for creating object states/groups and builds the InputStruct object.
protected buildCreateInputStruct ( string $identifier, string $defaultLanguageCode, string[] $names, string[] $descriptions ) : eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct
$identifier string
$defaultLanguageCode string
$names string[]
$descriptions string[]
return eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct

buildDomainObjectStateGroupObject() protected method

Converts the object state group SPI value object to API value object.
protected buildDomainObjectStateGroupObject ( eZ\Publish\SPI\Persistence\Content\ObjectState\Group $spiObjectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$spiObjectStateGroup eZ\Publish\SPI\Persistence\Content\ObjectState\Group
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

buildDomainObjectStateObject() protected method

Converts the object state SPI value object to API value object.
protected buildDomainObjectStateObject ( eZ\Publish\SPI\Persistence\Content\ObjectState $spiObjectState, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup = null ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$spiObjectState eZ\Publish\SPI\Persistence\Content\ObjectState
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

buildObjectStateGroupUpdateInputStruct() protected method

Validates input for updating object state groups and builds the InputStruct object.
protected buildObjectStateGroupUpdateInputStruct ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, string $identifier, string $defaultLanguageCode, string[] $names, string[] $descriptions ) : eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$identifier string
$defaultLanguageCode string
$names string[]
$descriptions string[]
return eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct

buildObjectStateUpdateInputStruct() protected method

Validates input for updating object states and builds the InputStruct object.
protected buildObjectStateUpdateInputStruct ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, string $identifier, string $defaultLanguageCode, string[] $names, string[] $descriptions ) : eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$identifier string
$defaultLanguageCode string
$names string[]
$descriptions string[]
return eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct

createObjectState() public method

Note: in current kernel: If it is the first state all content objects will set to this state.
public createObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct $objectStateCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateCreateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

createObjectStateGroup() public method

Creates a new object state group.
public createObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct $objectStateGroupCreateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroupCreateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

deleteObjectState() public method

Deletes a object state. The state of the content objects is reset to the first object state in the group.
public deleteObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState )
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState

deleteObjectStateGroup() public method

Deletes a object state group including all states and links to content.
public deleteObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup )
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

getContentCount() public method

Returns the number of objects which are in this state.
public getContentCount ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState ) : integer
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
return integer

getContentState() public method

The $state is the id of the state within one group.
public getContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

loadObjectState() public method

Loads an object state.
public loadObjectState ( mixed $stateId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$stateId mixed
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

loadObjectStateGroup() public method

Loads a object state group.
public loadObjectStateGroup ( mixed $objectStateGroupId ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroupId mixed
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

loadObjectStateGroups() public method

Loads all object state groups.
public loadObjectStateGroups ( integer $offset, integer $limit ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup[]
$offset integer
$limit integer
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup[]

loadObjectStates() public method

This method returns the ordered list of object states of a group.
public loadObjectStates ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState[]
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState[]

newObjectStateCreateStruct() public method

Instantiates a new Object State Create Struct and sets $identifier in it.
public newObjectStateCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct
$identifier string
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateCreateStruct

newObjectStateGroupCreateStruct() public method

Instantiates a new Object State Group Create Struct and sets $identified in it.
public newObjectStateGroupCreateStruct ( string $identifier ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct
$identifier string
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupCreateStruct

newObjectStateGroupUpdateStruct() public method

Instantiates a new Object State Group Update Struct.
public newObjectStateGroupUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct

newObjectStateUpdateStruct() public method

Instantiates a new Object State Update Struct.
public newObjectStateUpdateStruct ( ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct

setContentState() public method

Sets the object-state of a state group to $state for the given content.
public setContentState ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState )
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState

setPriorityOfObjectState() public method

Changes the priority of the state.
public setPriorityOfObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, integer $priority )
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$priority integer

updateObjectState() public method

Updates an object state.
public updateObjectState ( eZ\Publish\API\Repository\Values\ObjectState\ObjectState $objectState, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct $objectStateUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$objectState eZ\Publish\API\Repository\Values\ObjectState\ObjectState
$objectStateUpdateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectState

updateObjectStateGroup() public method

Updates an object state group.
public updateObjectStateGroup ( eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup, eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct $objectStateGroupUpdateStruct ) : eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroup eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup
$objectStateGroupUpdateStruct eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroupUpdateStruct
return eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup

Property Details

$objectStateHandler protected_oe property

protected Handler,eZ\Publish\SPI\Persistence\Content\ObjectState $objectStateHandler
return eZ\Publish\SPI\Persistence\Content\ObjectState\Handler

$repository protected_oe property

protected Repository,eZ\Publish\API\Repository $repository
return eZ\Publish\API\Repository\Repository

$settings protected_oe property

protected array $settings
return array