CommandMap
readonly class \
Handles the \TYPO3\CMS\Core\DataHandling\DataHandler command map and is only used in combination with \TYPO3\CMS\Core\DataHandling\DataHandler
Internal
Table of Contents
Properties
- $eventDispatcher : EventDispatcherInterface
Methods
- __construct() : mixed
- process() : array
- Processes the command map.
- getCommonClearProperties() : array
- Gets common properties of dependent elements for clearing.
- getCommonPublishProperties() : array
- Gets common properties of dependent elements for publishing.
- getCommonStageProperties() : array
- Gets common properties of dependent elements for staging, in the shape of the "change_stage" command.
- isChangeStageCommand() : bool
- isLegacyDiscardCommand() : bool
- isLegacySetStageCommand() : bool
- resolveWorkspacesDiscardDependencies() : array
- Resolves workspaces related dependencies for discarding of the command map.
- resolveWorkspacesPublishDependencies() : array
- Resolves workspaces related dependencies for publishing of the command map.
- resolveWorkspacesSetStageDependencies() : array
- Resolves workspaces related dependencies for staging of the command map.
- toLegacySetStageProperties() : array
Properties
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
Methods
__construct()
public
__construct(EventDispatcherInterface $eventDispatcher) : mixed
Parameters
- $eventDispatcher : EventDispatcherInterface
process()
Processes the command map.
public
process(array $commandMap, int $workspace) : array
Parameters
- $commandMap : array
- $workspace : int
Return values
arraygetCommonClearProperties()
Gets common properties of dependent elements for clearing.
protected
getCommonClearProperties(ElementEntity $element) : array
Parameters
- $element : ElementEntity
Return values
arraygetCommonPublishProperties()
Gets common properties of dependent elements for publishing.
protected
getCommonPublishProperties(ElementEntity $element) : array
Parameters
- $element : ElementEntity
Return values
arraygetCommonStageProperties()
Gets common properties of dependent elements for staging, in the shape of the "change_stage" command.
protected
getCommonStageProperties(ElementEntity $element) : array
Parameters
- $element : ElementEntity
Return values
arrayisChangeStageCommand()
protected
isChangeStageCommand(mixed $properties) : bool
Parameters
- $properties : mixed
Return values
boolisLegacyDiscardCommand()
protected
isLegacyDiscardCommand(mixed $properties) : bool
Parameters
- $properties : mixed
Return values
boolisLegacySetStageCommand()
protected
isLegacySetStageCommand(mixed $properties) : bool
Parameters
- $properties : mixed
Return values
boolresolveWorkspacesDiscardDependencies()
Resolves workspaces related dependencies for discarding of the command map.
protected
resolveWorkspacesDiscardDependencies(array $commandMap, int $workspace) : array
Workspaces records that are children or (relative) parents of a discarded record and are delete placeholders, but not discarded with this request, are added to the command map.
Every element keeps the command it was requested with, and dependent elements pulled in by the resolver take the command of the element that was requested, so the native "discard" command is never turned into an empty "version" command.
Parameters
- $commandMap : array
- $workspace : int
Return values
arrayresolveWorkspacesPublishDependencies()
Resolves workspaces related dependencies for publishing of the command map.
protected
resolveWorkspacesPublishDependencies(array $commandMap, int $workspace) : array
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.
Dependencies are resolved on versioned record uids: ElementEntity, DependencyResolver and the sys_refindex lookups in between all address a record by the uid of its workspace version, and the live uid is derived data (ElementEntity data key "liveId"). The "publish" command is keyed by that very versioned uid, the legacy "version" command is keyed by the live uid and carries the versioned uid in "swapWith" - so both end up as the same element and only the command map key differs.
Parameters
- $commandMap : array
- $workspace : int
Return values
arrayresolveWorkspacesSetStageDependencies()
Resolves workspaces related dependencies for staging of the command map.
protected
resolveWorkspacesSetStageDependencies(array $commandMap, int $workspace) : array
Workspaces records that have children or (relative) parents which are versionized but not staged with this request, are removed from the command map.
The "change_stage" command and the legacy "version" command with action "setStage" are both keyed by the versioned uid. Every element keeps the command it was requested with, and dependent elements pulled in by the resolver take the command of the element that was requested, so processCmdmap hooks always see the shape the caller sent.
Parameters
- $commandMap : array
- $workspace : int
Return values
arraytoLegacySetStageProperties()
protected
toLegacySetStageProperties(array $properties) : array
Parameters
- $properties : array