StagesService implements SingletonInterface

Internal

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Constants

STAGE_EDIT_ID  = 0
STAGE_PUBLISH_EXECUTE_ID  = -20
STAGE_PUBLISH_ID  = -10
TABLE_STAGE  = 'sys_workspace_stage'

Properties

$recordService  : RecordService|null
$workspaceStageAllowedCache  : array<string|int, mixed>
$workspaceStageCache  : array<string|int, mixed>
Local cache to reduce number of database queries for stages, groups, etc.

Methods

getAllStagesOfWorkspace()  : array<string|int, mixed>
Building an array with all stage ids and titles related to the given workspace
getBackendUsers()  : array<string|int, mixed>
Gets backend user records from a given list of ids.
getNextStage()  : array<string|int, mixed>
Gets next stage in process for given stage id
getNextStageForElementCollection()  : array<string|int, mixed>
Retrieve the next stage based on the lowest stage given in the $workspaceItems record array.
getPositionOfCurrentStage()  : array<string|int, mixed>
Gets the position of the given workspace in the hole process f.e. 3 means step 3 of 20, by which 1 is edit and 20 is ready to publish
getPreselectedRecipients()  : array<string|int, mixed>
getPreviousStageForElementCollection()  : array<string|int, mixed>
Find the highest possible "previous" stage for all $byTableName
getPrevStage()  : false|array<string|int, mixed>
Get next stage in process for given stage id
getPropertyOfCurrentWorkspaceStage()  : string|null
Gets a property of a workspaces stage.
getRecordService()  : RecordService
getResponsibleBeUser()  : array<string|int, mixed>
Gets all backend user records that are considered to be responsible for a particular stage or workspace.
getStagesForWSUser()  : array<string|int, mixed>
Returns an array of stages, the user is allowed to send to
getStageTitle()  : string
Gets the title of a stage
getWorkspaceId()  : int
Getter for current workspace id
isNextStageAllowedForUser()  : bool
Check if the user has access to the next stage, relative to the given stage
isPrevStageAllowedForUser()  : bool
Check if the user has access to the previous stage, relative to the given stage
isValid()  : bool
Determines whether a stageId is valid.
resolveBackendUserIds()  : array<string|int, mixed>
Resolves backend user ids from a mixed list of backend users and backend user groups (e.g. "be_users_1,be_groups_3,be_users_4,...")
getBackendUser()  : BackendUserAuthentication
getLanguageService()  : LanguageService|null
getNextStages()  : array<string|int, mixed>
Recursive function to get all next stages for a record depending on user permissions
getPrevStages()  : array<string|int, mixed>
Recursive function to get all prev stages for a record depending on user permissions
getWorkspaceRecord()  : WorkspaceRecord
isStageAllowedForUser()  : bool
prepareStagesArray()  : array<string|int, mixed>
Prepares simplified stages array

Constants

STAGE_EDIT_ID

public mixed STAGE_EDIT_ID = 0

STAGE_PUBLISH_EXECUTE_ID

public mixed STAGE_PUBLISH_EXECUTE_ID = -20

STAGE_PUBLISH_ID

public mixed STAGE_PUBLISH_ID = -10

TABLE_STAGE

public mixed TABLE_STAGE = 'sys_workspace_stage'

Properties

$workspaceStageAllowedCache

protected array<string|int, mixed> $workspaceStageAllowedCache = []

$workspaceStageCache

Local cache to reduce number of database queries for stages, groups, etc.

protected array<string|int, mixed> $workspaceStageCache = []

Methods

getAllStagesOfWorkspace()

Building an array with all stage ids and titles related to the given workspace

public getAllStagesOfWorkspace() : array<string|int, mixed>
Return values
array<string|int, mixed>

id and title of the stages

getBackendUsers()

Gets backend user records from a given list of ids.

public getBackendUsers(array<string|int, mixed> $backendUserIds) : array<string|int, mixed>
Parameters
$backendUserIds : array<string|int, mixed>
Return values
array<string|int, mixed>

getNextStage()

Gets next stage in process for given stage id

public getNextStage(int $stageId) : array<string|int, mixed>
Parameters
$stageId : int

Id of the stage to fetch the next one for

Return values
array<string|int, mixed>

The next stage (id + details)

getNextStageForElementCollection()

Retrieve the next stage based on the lowest stage given in the $workspaceItems record array.

public getNextStageForElementCollection(array<string|int, mixed> $workspaceItems[, array<string|int, mixed> $byTableName = ['tt_content', 'pages'] ]) : array<string|int, mixed>
Parameters
$workspaceItems : array<string|int, mixed>
$byTableName : array<string|int, mixed> = ['tt_content', 'pages']
Return values
array<string|int, mixed>

Current and next possible stage.

getPositionOfCurrentStage()

Gets the position of the given workspace in the hole process f.e. 3 means step 3 of 20, by which 1 is edit and 20 is ready to publish

public getPositionOfCurrentStage(int $stageId) : array<string|int, mixed>
Parameters
$stageId : int
Return values
array<string|int, mixed>

position => 3, count => 20

getPreselectedRecipients()

public getPreselectedRecipients(StageRecord $stageRecord) : array<string|int, mixed>
Parameters
$stageRecord : StageRecord
Return values
array<string|int, mixed>

getPreviousStageForElementCollection()

Find the highest possible "previous" stage for all $byTableName

public getPreviousStageForElementCollection(array<string|int, mixed> $workspaceItems[, array<string|int, mixed> $byTableName = ['tt_content', 'pages'] ]) : array<string|int, mixed>
Parameters
$workspaceItems : array<string|int, mixed>
$byTableName : array<string|int, mixed> = ['tt_content', 'pages']
Return values
array<string|int, mixed>

Current and next highest possible stage

getPrevStage()

Get next stage in process for given stage id

public getPrevStage(int $stageId) : false|array<string|int, mixed>
Parameters
$stageId : int

Id of the stage to fetch the previous one for

Return values
false|array<string|int, mixed>

The previous stage or false

getPropertyOfCurrentWorkspaceStage()

Gets a property of a workspaces stage.

public getPropertyOfCurrentWorkspaceStage(int $stageId, string $property) : string|null
Parameters
$stageId : int
$property : string
Return values
string|null

getResponsibleBeUser()

Gets all backend user records that are considered to be responsible for a particular stage or workspace.

public getResponsibleBeUser(StageRecord|int $stageRecord[, bool $selectDefaultUserField = false ]) : array<string|int, mixed>
Parameters
$stageRecord : StageRecord|int
$selectDefaultUserField : bool = false

If field notification_defaults should be selected instead of responsible users

Return values
array<string|int, mixed>

be_users with e-mail and name

getStagesForWSUser()

Returns an array of stages, the user is allowed to send to

public getStagesForWSUser() : array<string|int, mixed>
Return values
array<string|int, mixed>

id and title of stages

getStageTitle()

Gets the title of a stage

public getStageTitle(int $stageId) : string
Parameters
$stageId : int
Return values
string

getWorkspaceId()

Getter for current workspace id

public getWorkspaceId() : int
Return values
int

isNextStageAllowedForUser()

Check if the user has access to the next stage, relative to the given stage

public isNextStageAllowedForUser(int $stageId) : bool
Parameters
$stageId : int
Return values
bool

isPrevStageAllowedForUser()

Check if the user has access to the previous stage, relative to the given stage

public isPrevStageAllowedForUser(int $stageId) : bool
Parameters
$stageId : int
Return values
bool

isValid()

Determines whether a stageId is valid.

public isValid(int $stageId) : bool
Parameters
$stageId : int
Return values
bool

resolveBackendUserIds()

Resolves backend user ids from a mixed list of backend users and backend user groups (e.g. "be_users_1,be_groups_3,be_users_4,...")

public resolveBackendUserIds(string $backendUserGroupList) : array<string|int, mixed>
Parameters
$backendUserGroupList : string
Return values
array<string|int, mixed>

getNextStages()

Recursive function to get all next stages for a record depending on user permissions

protected getNextStages(array<string|int, mixed> &$nextStageArray, int $stageId) : array<string|int, mixed>
Parameters
$nextStageArray : array<string|int, mixed>

Next stages

$stageId : int

Current stage id of the record

Return values
array<string|int, mixed>

Next stages

getPrevStages()

Recursive function to get all prev stages for a record depending on user permissions

protected getPrevStages(array<string|int, mixed> &$prevStageArray, int $stageId) : array<string|int, mixed>
Parameters
$prevStageArray : array<string|int, mixed>

Prev stages

$stageId : int

Current stage id of the record

Return values
array<string|int, mixed>

prev stages

isStageAllowedForUser()

protected isStageAllowedForUser(int $stageId) : bool
Parameters
$stageId : int
Return values
bool

prepareStagesArray()

Prepares simplified stages array

protected prepareStagesArray(array<string|int, StageRecord$stageRecords) : array<string|int, mixed>
Parameters
$stageRecords : array<string|int, StageRecord>
Return values
array<string|int, mixed>

        
On this page

Search results