‪TYPO3CMS  ‪main
TYPO3\CMS\Workspaces\DataHandler\CommandMap Class Reference

Public Member Functions

 __construct (array $commandMap, int $workspace)
 
 get ()
 
 set (array $commandMap)
 
 setWorkspace (int $workspace)
 
 getWorkspace ()
 
 process ()
 

Public Attributes

const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap'
 
const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage'
 
const SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear'
 
const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback'
 
const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback'
 
const KEY_ElementConstructCallback = 'KEY_EventConstructCallback'
 
const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback'
 
const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback'
 
const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback'
 
const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId'
 

Protected Member Functions

 getElementEntityProcessor ()
 
 resolveWorkspacesSwapDependencies ()
 
 addWorkspacesSwapElements (DependencyResolver $dependency, string $table, int $liveId, array $properties)
 
 invokeWorkspacesSetStageItems (string $callbackMethod, array $arguments=[])
 
 resolveWorkspacesSetStageDependencies ()
 
 addWorkspacesSetStageElements (DependencyResolver $dependency, string $table, int $versionId, array $properties)
 
 resolveWorkspacesClearDependencies ()
 
 explodeSetStage (string $table, string|int $versionIdList, array $properties)
 
 applyWorkspacesDependencies (DependencyResolver $dependency, string $scope)
 
 update (ElementEntity $intersectingElement, array $elements, string $scope)
 
 mergeToTop (array $commandMap)
 
 mergeToBottom (array $commandMap)
 
 remove (string $table, int|string $id, string $command=null)
 
 getElementLiveIdCallback (ElementEntity $element)
 
 getElementIdCallback (ElementEntity $element)
 
 getElementSwapPropertiesCallback (ElementEntity $element)
 
array getCommonClearPropertiesCallback (ElementEntity $element)
 
 getCommonSwapPropertiesCallback (ElementEntity $element)
 
 getElementSetStagePropertiesCallback (ElementEntity $element)
 
 getCommonSetStagePropertiesCallback (ElementEntity $element)
 
 getDependencyUtility (string $scope)
 
 constructScopes ()
 
 getScopeData (string $scope, string $key)
 
 getDependencyCallback (string $method, array $targetArguments=[])
 
 processCallback (string $method, array $callbackArguments)
 

Protected Attributes

array $commandMap = []
 
int $workspace
 
array $scopes = []
 
ElementEntityProcessor $elementEntityProcessor
 

Detailed Description

Handles the \TYPO3\CMS\Core\DataHandling\DataHandler command map and is only used in combination with \TYPO3\CMS\Core\DataHandling\DataHandler

Definition at line 34 of file CommandMap.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::__construct ( array  $commandMap,
int  $workspace 
)

Member Function Documentation

◆ addWorkspacesSetStageElements()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::addWorkspacesSetStageElements ( DependencyResolver  $dependency,
string  $table,
int  $versionId,
array  $properties 
)
protected

Adds workspaces elements for staging.

Definition at line 186 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\DependencyResolver\addElement().

◆ addWorkspacesSwapElements()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::addWorkspacesSwapElements ( DependencyResolver  $dependency,
string  $table,
int  $liveId,
array  $properties 
)
protected

Adds workspaces elements for swapping/publishing.

Definition at line 143 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\DependencyResolver\addElement().

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesSwapDependencies().

◆ applyWorkspacesDependencies()

◆ constructScopes()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::constructScopes ( )
protected

Constructs the scope settings. Currently, the scopes for swapping/publishing and staging are available.

Definition at line 433 of file CommandMap.php.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\__construct().

◆ explodeSetStage()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::explodeSetStage ( string  $table,
string|int  $versionIdList,
array  $properties 
)
protected

Explodes id-lists in the command map for staging actions.

Definition at line 216 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToBottom(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ get()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::get ( )

Gets the command map.

Definition at line 62 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap.

◆ getCommonClearPropertiesCallback()

array TYPO3\CMS\Workspaces\DataHandler\CommandMap::getCommonClearPropertiesCallback ( ElementEntity  $element)
protected

Callback to get common properties of dependent elements for clearing.

Returns
‪array

Definition at line 347 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\ElementEntity\getDataValue().

◆ getCommonSetStagePropertiesCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getCommonSetStagePropertiesCallback ( ElementEntity  $element)
protected

Callback to get common properties of dependent elements for staging.

Definition at line 388 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\ElementEntity\getDataValue().

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementSetStagePropertiesCallback().

◆ getCommonSwapPropertiesCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getCommonSwapPropertiesCallback ( ElementEntity  $element)
protected

Callback to get common properties of dependent elements for swapping/publishing.

Definition at line 360 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\ElementEntity\getDataValue().

◆ getDependencyCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getDependencyCallback ( string  $method,
array  $targetArguments = [] 
)
protected

Gets a new callback to be used in the dependency resolver utility.

Definition at line 506 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementEntityProcessor().

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyUtility().

◆ getDependencyUtility()

◆ getElementEntityProcessor()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getElementEntityProcessor ( )
protected

◆ getElementIdCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getElementIdCallback ( ElementEntity  $element)
protected

Callback to get the real id of a dependent element.

Definition at line 327 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\ElementEntity\getId().

◆ getElementLiveIdCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getElementLiveIdCallback ( ElementEntity  $element)
protected

Callback to get the liveId of a dependent element.

Definition at line 319 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\ElementEntity\getDataValue().

◆ getElementSetStagePropertiesCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getElementSetStagePropertiesCallback ( ElementEntity  $element)
protected

Callback to get the specific properties of a dependent element for staging.

Definition at line 380 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonSetStagePropertiesCallback().

◆ getElementSwapPropertiesCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getElementSwapPropertiesCallback ( ElementEntity  $element)
protected

Callback to get the specific properties of a dependent element for swapping/publishing.

Definition at line 335 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\ElementEntity\getId().

◆ getScopeData()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getScopeData ( string  $scope,
string  $key 
)
protected

◆ getWorkspace()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::getWorkspace ( )

◆ invokeWorkspacesSetStageItems()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::invokeWorkspacesSetStageItems ( string  $callbackMethod,
array  $arguments = [] 
)
protected

Invokes all items for staging with a callback method.

Parameters
array$arguments‪Optional leading arguments for the callback method

Definition at line 153 of file CommandMap.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesSetStageDependencies().

◆ mergeToBottom()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::mergeToBottom ( array  $commandMap)
protected

Merges command map elements to the bottom of the current command map.

Definition at line 299 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\explodeSetStage().

◆ mergeToTop()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::mergeToTop ( array  $commandMap)
protected

Merges command map elements to the top of the current command map.

Definition at line 290 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\update().

◆ process()

◆ processCallback()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::processCallback ( string  $method,
array  $callbackArguments 
)
protected

Processes a local callback inside this object.

Definition at line 519 of file CommandMap.php.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\update().

◆ remove()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::remove ( string  $table,
int|string  $id,
string  $command = null 
)
protected

Removes an element from the command map.

Definition at line 307 of file CommandMap.php.

◆ resolveWorkspacesClearDependencies()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::resolveWorkspacesClearDependencies ( )
protected

Resolves workspaces related dependencies for clearing/flushing of the command map. Workspaces records that have children or (relative) parents which are versionized but not cleared/flushed with this request, are removed from the command map.

Definition at line 196 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesDependencies(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyUtility(), and TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesClear.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\process().

◆ resolveWorkspacesSetStageDependencies()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::resolveWorkspacesSetStageDependencies ( )
protected

Resolves workspaces related dependencies for staging of the command map. Workspaces records that have children or (relative) parents which are versionized but not staged with this request, are removed from the command map.

Definition at line 174 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesDependencies(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyUtility(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\invokeWorkspacesSetStageItems(), and TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesSetStage.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\process().

◆ resolveWorkspacesSwapDependencies()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::resolveWorkspacesSwapDependencies ( )
protected

Resolves workspaces related dependencies for swapping/publishing of the command map. 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.

Definition at line 121 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\addWorkspacesSwapElements(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesDependencies(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyUtility(), and TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesSwap.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\process().

◆ set()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::set ( array  $commandMap)

Sets the command map.

Definition at line 70 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap.

◆ setWorkspace()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::setWorkspace ( int  $workspace)

Sets the current workspace.

Definition at line 79 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspace.

Referenced by TYPO3\CMS\Workspaces\DataHandler\CommandMap\__construct().

◆ update()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::update ( ElementEntity  $intersectingElement,
array  $elements,
string  $scope 
)
protected

Member Data Documentation

◆ $commandMap

◆ $elementEntityProcessor

ElementEntityProcessor TYPO3\CMS\Workspaces\DataHandler\CommandMap::$elementEntityProcessor
protected

◆ $scopes

array TYPO3\CMS\Workspaces\DataHandler\CommandMap::$scopes = []
protected

Definition at line 49 of file CommandMap.php.

◆ $workspace

int TYPO3\CMS\Workspaces\DataHandler\CommandMap::$workspace
protected

◆ KEY_ElementConstructCallback

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_ElementConstructCallback = 'KEY_EventConstructCallback'

Definition at line 41 of file CommandMap.php.

◆ KEY_ElementCreateChildReferenceCallback

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback'

Definition at line 42 of file CommandMap.php.

◆ KEY_ElementCreateParentReferenceCallback

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback'

Definition at line 43 of file CommandMap.php.

◆ KEY_GetCommonPropertiesCallback

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback'

Definition at line 40 of file CommandMap.php.

◆ KEY_GetElementPropertiesCallback

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback'

Definition at line 39 of file CommandMap.php.

◆ KEY_TransformDependentElementsToUseLiveId

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId'

Definition at line 45 of file CommandMap.php.

◆ KEY_UpdateGetIdCallback

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback'

Definition at line 44 of file CommandMap.php.

◆ SCOPE_WorkspacesClear

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear'

◆ SCOPE_WorkspacesSetStage

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage'

◆ SCOPE_WorkspacesSwap

const TYPO3\CMS\Workspaces\DataHandler\CommandMap::SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap'