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

Public Member Functions

 __construct (DataHandlerHook $parent, DataHandler $tceMain, array $commandMap, $workspace)
 
array get ()
 
CommandMap set (array $commandMap)
 
DataHandlerHook getParent ()
 
CommandMap setParent (DataHandlerHook $parent)
 
DataHandler getTceMain ()
 
CommandMap setTceMain (DataHandler $tceMain)
 
 setWorkspace ($workspace)
 
int getWorkspace ()
 
CommandMap setWorkspacesSwapMode ($workspacesSwapMode)
 
CommandMap setWorkspacesChangeStageMode ($workspacesChangeStageMode)
 
CommandMap 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

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

Protected Attributes

DataHandlerHook $parent
 
DataHandler $tceMain
 
array $commandMap = array( )
 
int $workspace
 
string $workspacesSwapMode
 
string $workspacesChangeStageMode
 
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 33 of file CommandMap.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addWorkspacesSetStageElements()

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

Adds workspaces elements for staging.

Parameters
DependencyResolver$dependency
string$table
string$versionId
array$properties

Definition at line 417 of file CommandMap.php.

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

◆ addWorkspacesSwapElements()

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

Adds workspaces elements for swapping/publishing.

Parameters
DependencyResolver$dependency
string$table
int$liveId
array$properties

Definition at line 309 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Dependency\DependencyResolver\addElement(), TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageElementsForVersionSwap(), and TYPO3\CMS\Workspaces\DataHandler\CommandMap\getParent().

◆ applyWorkspacesDependencies()

◆ applyWorkspacesSetStageBehaviour()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::applyWorkspacesSetStageBehaviour (   $table,
  $versionIdList,
array  $properties 
)
protected

◆ applyWorkspacesSwapBehaviour()

TYPO3\CMS\Workspaces\DataHandler\CommandMap::applyWorkspacesSwapBehaviour (   $table,
  $liveId,
array  $properties 
)
protected

Applies workspaces behaviour for swapping/publishing and takes care of the swapMode.

Parameters
string$table
int$liveId
array$properties

Definition at line 282 of file CommandMap.php.

References TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageElementsForVersionSwap(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\getParent(), and TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToBottom().

◆ 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 707 of file CommandMap.php.

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

◆ explodeSetStage()

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

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

Exceptions

Definition at line 452 of file CommandMap.php.

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

◆ get()

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

Gets the command map.

Returns
‪array

Definition at line 102 of file CommandMap.php.

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

Referenced by TYPO3\CMS\Workspaces\Hook\DataHandlerHook\processCmdmap_beforeStart().

◆ getCommonClearPropertiesCallback()

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

Callback to get common properties of dependent elements for clearing.

Parameters
ElementEntity$element
Returns
‪array

Definition at line 608 of file CommandMap.php.

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

◆ getCommonSetStagePropertiesCallback()

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

Callback to get common properties of dependent elements for staging.

Parameters
ElementEntity$element
Returns
‪array

Definition at line 661 of file CommandMap.php.

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

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

◆ getCommonSwapPropertiesCallback()

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

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

Parameters
ElementEntity$element
Returns
‪array

Definition at line 624 of file CommandMap.php.

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

◆ getDependencyCallback()

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

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

Parameters
string$method
array$targetArguments
Returns
‪EventCallback

Definition at line 787 of file CommandMap.php.

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

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

◆ getDependencyUtility()

◆ getElementEntityProcessor()

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

◆ getElementIdCallback()

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

Callback to get the real id of a dependent element.

Parameters
ElementEntity$element
Returns
‪int

Definition at line 584 of file CommandMap.php.

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

◆ getElementLiveIdCallback()

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

Callback to get the liveId of a dependent element.

Parameters
ElementEntity$element
Returns
‪int

Definition at line 573 of file CommandMap.php.

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

◆ getElementSetStagePropertiesCallback()

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

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

Parameters
ElementEntity$element
Returns
‪array

Definition at line 650 of file CommandMap.php.

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

◆ getElementSwapPropertiesCallback()

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

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

Parameters
ElementEntity$element
Returns
‪array

Definition at line 595 of file CommandMap.php.

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

◆ getParent()

◆ getScopeData()

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

◆ getTceMain()

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

Gets the parent object.

Returns
DataHandler

Definition at line 146 of file CommandMap.php.

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

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

◆ getWorkspace()

◆ invokeWorkspacesSetStageItems()

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

Invokes all items for staging with a callback method.

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

Definition at line 332 of file CommandMap.php.

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

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

◆ invokeWorkspacesSwapItems()

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

Invokes all items for swapping/publishing with a callback method.

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

Definition at line 242 of file CommandMap.php.

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

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

◆ mergeToBottom()

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

◆ mergeToTop()

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

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

Parameters
array$commandMap

Definition at line 535 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap, and TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

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

◆ process()

◆ processCallback()

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

Processes a local callback inside this object.

Parameters
string$method
array$callbackArguments
Returns
‪mixed

Definition at line 804 of file CommandMap.php.

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

◆ remove()

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

Removes an element from the command map.

Parameters
string$table
string$id
string$command‪(optional)

Definition at line 558 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 427 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 353 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 264 of file CommandMap.php.

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

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

◆ set()

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

Sets the command map.

Parameters
array$commandMap
Returns
CommandMap

Definition at line 113 of file CommandMap.php.

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

◆ setParent()

CommandMap TYPO3\CMS\Workspaces\DataHandler\CommandMap::setParent ( DataHandlerHook  $parent)

Sets the parent object.

Parameters
DataHandlerHook$parent
Returns
CommandMap

Definition at line 135 of file CommandMap.php.

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

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

◆ setTceMain()

CommandMap TYPO3\CMS\Workspaces\DataHandler\CommandMap::setTceMain ( DataHandler  $tceMain)

Sets the parent object.

Parameters
DataHandler$tceMain
Returns
CommandMap

Definition at line 157 of file CommandMap.php.

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

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

◆ setWorkspace()

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

Sets the current workspace.

Parameters
int$workspace

Definition at line 168 of file CommandMap.php.

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

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

◆ setWorkspacesChangeStageMode()

CommandMap TYPO3\CMS\Workspaces\DataHandler\CommandMap::setWorkspacesChangeStageMode (   $workspacesChangeStageMode)

Sets the workspaces change stage mode see options.workspaces.changeStageMode)

Parameters
string$workspacesChangeStageMode
Returns
CommandMap

Definition at line 203 of file CommandMap.php.

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

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

◆ setWorkspacesSwapMode()

CommandMap TYPO3\CMS\Workspaces\DataHandler\CommandMap::setWorkspacesSwapMode (   $workspacesSwapMode)

Sets the workspaces swap mode (see options.workspaces.swapMode).

Parameters
string$workspacesSwapMode
Returns
CommandMap

Definition at line 190 of file CommandMap.php.

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

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

◆ update()

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

Updates the command map accordant to valid structures and takes care of the correct order.

Parameters
ElementEntity$intersectingElement
array$elements
string$scope

Definition at line 506 of file CommandMap.php.

References TYPO3\CMS\Workspaces\DataHandler\CommandMap\getScopeData(), TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToTop(), and TYPO3\CMS\Workspaces\DataHandler\CommandMap\processCallback().

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

Member Data Documentation

◆ $commandMap

◆ $elementEntityProcessor

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

◆ $parent

DataHandlerHook TYPO3\CMS\Workspaces\DataHandler\CommandMap::$parent
protected

◆ $scopes

array TYPO3\CMS\Workspaces\DataHandler\CommandMap::$scopes
protected

Definition at line 72 of file CommandMap.php.

◆ $tceMain

DataHandler TYPO3\CMS\Workspaces\DataHandler\CommandMap::$tceMain
protected

◆ $workspace

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

◆ $workspacesChangeStageMode

string TYPO3\CMS\Workspaces\DataHandler\CommandMap::$workspacesChangeStageMode
protected

◆ $workspacesSwapMode

string TYPO3\CMS\Workspaces\DataHandler\CommandMap::$workspacesSwapMode
protected

◆ KEY_ElementConstructCallback

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

Definition at line 40 of file CommandMap.php.

◆ KEY_ElementCreateChildReferenceCallback

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

Definition at line 41 of file CommandMap.php.

◆ KEY_ElementCreateParentReferenceCallback

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

Definition at line 42 of file CommandMap.php.

◆ KEY_GetCommonPropertiesCallback

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

Definition at line 39 of file CommandMap.php.

◆ KEY_GetElementPropertiesCallback

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

Definition at line 38 of file CommandMap.php.

◆ KEY_TransformDependentElementsToUseLiveId

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

Definition at line 44 of file CommandMap.php.

◆ KEY_UpdateGetIdCallback

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

Definition at line 43 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'