CommandMap

readonly class \TYPO3\CMS\Workspaces\DataHandler\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

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

array

getCommonClearProperties()

Gets common properties of dependent elements for clearing.

protected getCommonClearProperties(ElementEntity $element) : array

Parameters

$element : ElementEntity

Return values

array

getCommonPublishProperties()

Gets common properties of dependent elements for publishing.

protected getCommonPublishProperties(ElementEntity $element) : array

Parameters

$element : ElementEntity

Return values

array

getCommonStageProperties()

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

array

isChangeStageCommand()

protected isChangeStageCommand(mixed $properties) : bool

Parameters

$properties : mixed

Return values

bool

isLegacyDiscardCommand()

protected isLegacyDiscardCommand(mixed $properties) : bool

Parameters

$properties : mixed

Return values

bool

isLegacySetStageCommand()

protected isLegacySetStageCommand(mixed $properties) : bool

Parameters

$properties : mixed

Return values

bool

resolveWorkspacesDiscardDependencies()

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

array

resolveWorkspacesPublishDependencies()

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

array

resolveWorkspacesSetStageDependencies()

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

array

toLegacySetStageProperties()

protected toLegacySetStageProperties(array $properties) : array

Parameters

$properties : array

Return values

array
On this page