CommandMap
Handles the \TYPO3\CMS\Core\DataHandling\DataHandler command map and is only used in combination with \TYPO3\CMS\Core\DataHandling\DataHandler
Table of Contents
Constants
- KEY_ElementConstructCallback = 'KEY_EventConstructCallback'
- KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback'
- KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback'
- KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback'
- KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback'
- KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId'
- KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback'
- SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear'
- SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage'
- SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap'
Properties
- $commandMap : array<string|int, mixed>
- $elementEntityProcessor : ElementEntityProcessor|null
- $scopes : array<string|int, mixed>
- $workspace : int
Methods
- __construct() : mixed
- get() : array<string|int, mixed>
- Gets the command map.
- getWorkspace() : int
- Gets the current workspace.
- process() : self
- Processes the command map.
- set() : self
- Sets the command map.
- setWorkspace() : void
- Sets the current workspace.
- addWorkspacesSetStageElements() : void
- Adds workspaces elements for staging.
- addWorkspacesSwapElements() : void
- Adds workspaces elements for swapping/publishing.
- applyWorkspacesDependencies() : void
- Applies the workspaces dependencies and removes incomplete structures or automatically completes them
- constructScopes() : void
- Constructs the scope settings.
- explodeSetStage() : void
- Explodes id-lists in the command map for staging actions.
- getCommonClearPropertiesCallback() : array<string|int, mixed>
- Callback to get common properties of dependent elements for clearing.
- getCommonSetStagePropertiesCallback() : array<string|int, mixed>
- Callback to get common properties of dependent elements for staging.
- getCommonSwapPropertiesCallback() : array<string|int, mixed>
- Callback to get common properties of dependent elements for swapping/publishing.
- getDependencyCallback() : EventCallback
- Gets a new callback to be used in the dependency resolver utility.
- getDependencyUtility() : DependencyResolver
- Gets an instance of the dependency resolver utility.
- getElementEntityProcessor() : ElementEntityProcessor
- Gets the element entity processor.
- getElementIdCallback() : int
- Callback to get the real id of a dependent element.
- getElementLiveIdCallback() : int
- Callback to get the liveId of a dependent element.
- getElementSetStagePropertiesCallback() : array<string|int, mixed>
- Callback to get the specific properties of a dependent element for staging.
- getElementSwapPropertiesCallback() : array<string|int, mixed>
- Callback to get the specific properties of a dependent element for swapping/publishing.
- getScopeData() : null|bool|string
- Gets data for a particular scope.
- invokeWorkspacesSetStageItems() : void
- Invokes all items for staging with a callback method.
- mergeToBottom() : void
- Merges command map elements to the bottom of the current command map.
- mergeToTop() : void
- Merges command map elements to the top of the current command map.
- processCallback() : mixed
- Processes a local callback inside this object.
- remove() : void
- Removes an element from the command map.
- resolveWorkspacesClearDependencies() : void
- Resolves workspaces related dependencies for clearing/flushing of the command map.
- resolveWorkspacesSetStageDependencies() : void
- Resolves workspaces related dependencies for staging of the command map.
- resolveWorkspacesSwapDependencies() : void
- Resolves workspaces related dependencies for swapping/publishing of the command map.
- update() : void
- Updates the command map accordant to valid structures and takes care of the correct order.
Constants
KEY_ElementConstructCallback
public
mixed
KEY_ElementConstructCallback
= 'KEY_EventConstructCallback'
KEY_ElementCreateChildReferenceCallback
public
mixed
KEY_ElementCreateChildReferenceCallback
= 'KEY_ElementCreateChildReferenceCallback'
KEY_ElementCreateParentReferenceCallback
public
mixed
KEY_ElementCreateParentReferenceCallback
= 'KEY_ElementCreateParentReferenceCallback'
KEY_GetCommonPropertiesCallback
public
mixed
KEY_GetCommonPropertiesCallback
= 'KEY_GetCommonPropertiesCallback'
KEY_GetElementPropertiesCallback
public
mixed
KEY_GetElementPropertiesCallback
= 'KEY_GetElementPropertiesCallback'
KEY_TransformDependentElementsToUseLiveId
public
mixed
KEY_TransformDependentElementsToUseLiveId
= 'KEY_TransformDependentElementsToUseLiveId'
KEY_UpdateGetIdCallback
public
mixed
KEY_UpdateGetIdCallback
= 'KEY_UpdateGetIdCallback'
SCOPE_WorkspacesClear
public
mixed
SCOPE_WorkspacesClear
= 'SCOPE_WorkspacesClear'
SCOPE_WorkspacesSetStage
public
mixed
SCOPE_WorkspacesSetStage
= 'SCOPE_WorkspacesSetStage'
SCOPE_WorkspacesSwap
public
mixed
SCOPE_WorkspacesSwap
= 'SCOPE_WorkspacesSwap'
Properties
$commandMap
protected
array<string|int, mixed>
$commandMap
= []
$elementEntityProcessor
protected
ElementEntityProcessor|null
$elementEntityProcessor
$scopes
protected
array<string|int, mixed>
$scopes
= []
$workspace
protected
int
$workspace
Methods
__construct()
public
__construct(array<string|int, mixed> $commandMap, int $workspace) : mixed
Parameters
- $commandMap : array<string|int, mixed>
- $workspace : int
get()
Gets the command map.
public
get() : array<string|int, mixed>
Return values
array<string|int, mixed>getWorkspace()
Gets the current workspace.
public
getWorkspace() : int
Return values
intprocess()
Processes the command map.
public
process() : self
Return values
selfset()
Sets the command map.
public
set(array<string|int, mixed> $commandMap) : self
Parameters
- $commandMap : array<string|int, mixed>
Return values
selfsetWorkspace()
Sets the current workspace.
public
setWorkspace(int $workspace) : void
Parameters
- $workspace : int
addWorkspacesSetStageElements()
Adds workspaces elements for staging.
protected
addWorkspacesSetStageElements(DependencyResolver $dependency, string $table, int $versionId, array<string|int, mixed> $properties) : void
Parameters
- $dependency : DependencyResolver
- $table : string
- $versionId : int
- $properties : array<string|int, mixed>
addWorkspacesSwapElements()
Adds workspaces elements for swapping/publishing.
protected
addWorkspacesSwapElements(DependencyResolver $dependency, string $table, int $liveId, array<string|int, mixed> $properties) : void
Parameters
- $dependency : DependencyResolver
- $table : string
- $liveId : int
- $properties : array<string|int, mixed>
applyWorkspacesDependencies()
Applies the workspaces dependencies and removes incomplete structures or automatically completes them
protected
applyWorkspacesDependencies(DependencyResolver $dependency, string $scope) : void
Parameters
- $dependency : DependencyResolver
- $scope : string
constructScopes()
Constructs the scope settings.
protected
constructScopes() : void
Currently, the scopes for swapping/publishing and staging are available.
explodeSetStage()
Explodes id-lists in the command map for staging actions.
protected
explodeSetStage(string $table, string|int $versionIdList, array<string|int, mixed> $properties) : void
Parameters
- $table : string
- $versionIdList : string|int
- $properties : array<string|int, mixed>
getCommonClearPropertiesCallback()
Callback to get common properties of dependent elements for clearing.
protected
getCommonClearPropertiesCallback(ElementEntity $element) : array<string|int, mixed>
Parameters
- $element : ElementEntity
Return values
array<string|int, mixed>getCommonSetStagePropertiesCallback()
Callback to get common properties of dependent elements for staging.
protected
getCommonSetStagePropertiesCallback(ElementEntity $element) : array<string|int, mixed>
Parameters
- $element : ElementEntity
Return values
array<string|int, mixed>getCommonSwapPropertiesCallback()
Callback to get common properties of dependent elements for swapping/publishing.
protected
getCommonSwapPropertiesCallback(ElementEntity $element) : array<string|int, mixed>
Parameters
- $element : ElementEntity
Return values
array<string|int, mixed>getDependencyCallback()
Gets a new callback to be used in the dependency resolver utility.
protected
getDependencyCallback(string $method[, array<string|int, mixed> $targetArguments = [] ]) : EventCallback
Parameters
- $method : string
- $targetArguments : array<string|int, mixed> = []
Return values
EventCallbackgetDependencyUtility()
Gets an instance of the dependency resolver utility.
protected
getDependencyUtility(string $scope) : DependencyResolver
Parameters
- $scope : string
-
Scope identifier
Return values
DependencyResolvergetElementEntityProcessor()
Gets the element entity processor.
protected
getElementEntityProcessor() : ElementEntityProcessor
Return values
ElementEntityProcessorgetElementIdCallback()
Callback to get the real id of a dependent element.
protected
getElementIdCallback(ElementEntity $element) : int
Parameters
- $element : ElementEntity
Return values
intgetElementLiveIdCallback()
Callback to get the liveId of a dependent element.
protected
getElementLiveIdCallback(ElementEntity $element) : int
Parameters
- $element : ElementEntity
Return values
intgetElementSetStagePropertiesCallback()
Callback to get the specific properties of a dependent element for staging.
protected
getElementSetStagePropertiesCallback(ElementEntity $element) : array<string|int, mixed>
Parameters
- $element : ElementEntity
Return values
array<string|int, mixed>getElementSwapPropertiesCallback()
Callback to get the specific properties of a dependent element for swapping/publishing.
protected
getElementSwapPropertiesCallback(ElementEntity $element) : array<string|int, mixed>
Parameters
- $element : ElementEntity
Return values
array<string|int, mixed>getScopeData()
Gets data for a particular scope.
protected
getScopeData(string $scope, string $key) : null|bool|string
Parameters
- $scope : string
-
Scope identifier
- $key : string
Return values
null|bool|stringinvokeWorkspacesSetStageItems()
Invokes all items for staging with a callback method.
protected
invokeWorkspacesSetStageItems(string $callbackMethod[, array<string|int, mixed> $arguments = [] ]) : void
Parameters
- $callbackMethod : string
- $arguments : array<string|int, mixed> = []
-
Optional leading arguments for the callback method
mergeToBottom()
Merges command map elements to the bottom of the current command map.
protected
mergeToBottom(array<string|int, mixed> $commandMap) : void
Parameters
- $commandMap : array<string|int, mixed>
mergeToTop()
Merges command map elements to the top of the current command map.
protected
mergeToTop(array<string|int, mixed> $commandMap) : void
Parameters
- $commandMap : array<string|int, mixed>
processCallback()
Processes a local callback inside this object.
protected
processCallback(string $method, array<string|int, mixed> $callbackArguments) : mixed
Parameters
- $method : string
- $callbackArguments : array<string|int, mixed>
remove()
Removes an element from the command map.
protected
remove(string $table, int|string $id[, string|null $command = null ]) : void
Parameters
- $table : string
- $id : int|string
- $command : string|null = null
resolveWorkspacesClearDependencies()
Resolves workspaces related dependencies for clearing/flushing of the command map.
protected
resolveWorkspacesClearDependencies() : void
Workspaces records that have children or (relative) parents which are versionized but not cleared/flushed with this request, are removed from the command map.
resolveWorkspacesSetStageDependencies()
Resolves workspaces related dependencies for staging of the command map.
protected
resolveWorkspacesSetStageDependencies() : void
Workspaces records that have children or (relative) parents which are versionized but not staged with this request, are removed from the command map.
resolveWorkspacesSwapDependencies()
Resolves workspaces related dependencies for swapping/publishing of the command map.
protected
resolveWorkspacesSwapDependencies() : void
Workspaces records that have children or (relative) parents which are versionized but not published with this request, are removed from the command map. Otherwise this would produce hanging record sets and lost references.
update()
Updates the command map accordant to valid structures and takes care of the correct order.
protected
update(ElementEntity $intersectingElement, array<string|int, mixed> $elements, string $scope) : void
Parameters
- $intersectingElement : ElementEntity
- $elements : array<string|int, mixed>
- $scope : string