TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Version\DataHandler\CommandMap Class Reference

Public Member Functions

 __construct (\TYPO3\CMS\Version\Hook\DataHandlerHook $parent, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain, array $commandMap, $workspace)
 
 get ()
 
 set (array $commandMap)
 
 getParent ()
 
 setParent (\TYPO3\CMS\Version\Hook\DataHandlerHook $parent)
 
 getTceMain ()
 
 setTceMain (\TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
 
 setWorkspace ($workspace)
 
 getWorkspace ()
 
 setWorkspacesSwapMode ($workspacesSwapMode)
 
 setWorkspacesChangeStageMode ($workspacesChangeStageMode)
 
 setWorkspacesConsiderReferences ($workspacesConsiderReferences)
 
 process ()
 

Public Attributes

const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap'
 
const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage'
 
const SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear'
 
const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage'
 
const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode'
 
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_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback'
 
const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback'
 
const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId'
 

Protected Member Functions

 getElementEntityProcessor ()
 
 invokeWorkspacesSwapItems ($callbackMethod, array $arguments=[])
 
 resolveWorkspacesSwapDependencies ()
 
 applyWorkspacesSwapBehaviour ($table, $liveId, array $properties)
 
 addWorkspacesSwapElements (\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $liveId, array $properties)
 
 invokeWorkspacesSetStageItems ($callbackMethod, array $arguments=[])
 
 resolveWorkspacesSetStageDependencies ()
 
 applyWorkspacesSetStageBehaviour ($table, $versionIdList, array $properties)
 
 addWorkspacesSetStageElements (\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $versionId, array $properties)
 
 resolveWorkspacesClearDependencies ()
 
 explodeSetStage ($table, $versionIdList, array $properties)
 
 mergeToTop (array $commandMap)
 
 mergeToBottom (array $commandMap)
 
 remove ($table, $id, $command=null)
 
 getElementLiveIdCallback (ElementEntity $element)
 
 getElementIdCallback (ElementEntity $element)
 
 getElementSwapPropertiesCallback (ElementEntity $element)
 
 getCommonClearPropertiesCallback (ElementEntity $element)
 
 getCommonSwapPropertiesCallback (ElementEntity $element)
 
 getElementSetStagePropertiesCallback (ElementEntity $element)
 
 getCommonSetStagePropertiesCallback (ElementEntity $element)
 
 constructScopes ()
 
 getScopeData ($scope, $key)
 
 getDependencyCallback ($method, array $targetArguments=[])
 
 processCallback ($method, array $callbackArguments)
 

Protected Attributes

 $parent
 
 $tceMain
 
 $commandMap = []
 
 $workspace
 
 $workspacesSwapMode
 
 $workspacesChangeStageMode
 
 $workspacesConsiderReferences
 
 $scopes
 
 $elementEntityProcessor
 

Detailed Description

Handles the command map and is only used in combination with

Definition at line 25 of file CommandMap.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addWorkspacesSetStageElements()

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

Adds workspaces elements for staging.

Parameters
\TYPO3\CMS\Version\Dependency\DependencyResolver$dependency
string$table
string$versionId
array$properties
Returns
void

Definition at line 448 of file CommandMap.php.

◆ addWorkspacesSwapElements()

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

Adds workspaces elements for swapping/publishing.

Parameters
\TYPO3\CMS\Version\Dependency\DependencyResolver$dependency
string$table
int$liveId
array$properties
Returns
void

Definition at line 338 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\getParent().

◆ applyWorkspacesSetStageBehaviour()

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

Applies workspaces behaviour for staging and takes care of the changeStageMode.

Parameters
string$table
string$versionIdList
array$properties
Returns
void

Definition at line 405 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\getParent(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), TYPO3\CMS\Version\DataHandler\CommandMap\getWorkspace(), TYPO3\CMS\Version\DataHandler\CommandMap\mergeToBottom(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ applyWorkspacesSwapBehaviour()

TYPO3\CMS\Version\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
Returns
void

Definition at line 310 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\getParent(), and TYPO3\CMS\Version\DataHandler\CommandMap\mergeToBottom().

◆ constructScopes()

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

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

Returns
void

Definition at line 776 of file CommandMap.php.

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

◆ explodeSetStage()

◆ get()

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

Gets the command map.

Returns
array

Definition at line 111 of file CommandMap.php.

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

◆ getCommonClearPropertiesCallback()

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

Callback to get common properties of dependent elements for clearing.

Parameters
ElementEntity$element
Returns
array

Definition at line 674 of file CommandMap.php.

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

◆ getCommonSetStagePropertiesCallback()

◆ getCommonSwapPropertiesCallback()

TYPO3\CMS\Version\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 690 of file CommandMap.php.

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

◆ getDependencyCallback()

TYPO3\CMS\Version\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

Definition at line 871 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\getElementEntityProcessor(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Version\DataHandler\CommandMap\getCommonSetStagePropertiesCallback().

◆ getElementEntityProcessor()

◆ getElementIdCallback()

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

Callback to get the real id of an dependent element.

Parameters
ElementEntity$element
Returns
int

Definition at line 650 of file CommandMap.php.

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

◆ getElementLiveIdCallback()

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

Callback to get the liveId of an dependent element.

Parameters
ElementEntity$element
Returns
int

Definition at line 639 of file CommandMap.php.

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

◆ getElementSetStagePropertiesCallback()

TYPO3\CMS\Version\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 716 of file CommandMap.php.

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

◆ getElementSwapPropertiesCallback()

TYPO3\CMS\Version\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 661 of file CommandMap.php.

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

◆ getParent()

◆ getScopeData()

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

◆ getTceMain()

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

◆ getWorkspace()

◆ invokeWorkspacesSetStageItems()

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

Invokes all items for staging with a callback method.

Parameters
string$callbackMethod
array$argumentsOptional leading arguments for the callback method
Returns
void

Definition at line 362 of file CommandMap.php.

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

◆ invokeWorkspacesSwapItems()

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

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

Parameters
string$callbackMethod
array$argumentsOptional leading arguments for the callback method
Returns
void

Definition at line 267 of file CommandMap.php.

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

◆ mergeToBottom()

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

◆ mergeToTop()

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

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

Parameters
array$commandMap
Returns
void

Definition at line 599 of file CommandMap.php.

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

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

◆ process()

◆ processCallback()

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

Processes a local callback inside this object.

Parameters
string$method
array$callbackArguments
Returns
mixed

Definition at line 888 of file CommandMap.php.

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

◆ remove()

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

Removes an element from the command map.

Parameters
string$table
string$id
string$command(optional)
Returns
void

Definition at line 624 of file CommandMap.php.

◆ resolveWorkspacesClearDependencies()

TYPO3\CMS\Version\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.

Returns
void

Definition at line 460 of file CommandMap.php.

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

◆ resolveWorkspacesSetStageDependencies()

TYPO3\CMS\Version\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.

Returns
void

Definition at line 385 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\invokeWorkspacesSetStageItems().

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

◆ resolveWorkspacesSwapDependencies()

TYPO3\CMS\Version\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.

Returns
void

Definition at line 291 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\invokeWorkspacesSwapItems().

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

◆ set()

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

Sets the command map.

Parameters
array$commandMap
Returns

Definition at line 122 of file CommandMap.php.

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

◆ setParent()

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

Sets the parent object.

Parameters
\TYPO3\CMS\Version\Hook\DataHandlerHook$parent
Returns

Definition at line 144 of file CommandMap.php.

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

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

◆ setTceMain()

TYPO3\CMS\Version\DataHandler\CommandMap::setTceMain ( \TYPO3\CMS\Core\DataHandling\DataHandler  $tceMain)

Sets the parent object.

Parameters
\TYPO3\CMS\Core\DataHandling\DataHandler$tceMain
Returns

Definition at line 166 of file CommandMap.php.

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

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

◆ setWorkspace()

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

Sets the current workspace.

Parameters
int$workspace

Definition at line 177 of file CommandMap.php.

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

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

◆ setWorkspacesChangeStageMode()

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

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

Parameters
string$workspacesChangeStageMode
Returns

Definition at line 212 of file CommandMap.php.

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

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

◆ setWorkspacesConsiderReferences()

TYPO3\CMS\Version\DataHandler\CommandMap::setWorkspacesConsiderReferences (   $workspacesConsiderReferences)

Sets the workspace behaviour to automatically consider references (see options.workspaces.considerReferences)

Parameters
bool$workspacesConsiderReferences
Returns

Definition at line 225 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\$workspacesConsiderReferences.

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

◆ setWorkspacesSwapMode()

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

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

Parameters
string$workspacesSwapMode
Returns

Definition at line 199 of file CommandMap.php.

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

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

Member Data Documentation

◆ $commandMap

◆ $elementEntityProcessor

TYPO3\CMS\Version\DataHandler\CommandMap::$elementEntityProcessor
protected

◆ $parent

TYPO3\CMS\Version\DataHandler\CommandMap::$parent
protected

◆ $scopes

TYPO3\CMS\Version\DataHandler\CommandMap::$scopes
protected

Definition at line 79 of file CommandMap.php.

◆ $tceMain

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

◆ $workspace

◆ $workspacesChangeStageMode

TYPO3\CMS\Version\DataHandler\CommandMap::$workspacesChangeStageMode
protected

◆ $workspacesConsiderReferences

TYPO3\CMS\Version\DataHandler\CommandMap::$workspacesConsiderReferences
protected

◆ $workspacesSwapMode

TYPO3\CMS\Version\DataHandler\CommandMap::$workspacesSwapMode
protected

◆ KEY_ElementConstructCallback

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

Definition at line 34 of file CommandMap.php.

◆ KEY_ElementCreateChildReferenceCallback

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

Definition at line 35 of file CommandMap.php.

◆ KEY_ElementCreateParentReferenceCallback

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

Definition at line 36 of file CommandMap.php.

◆ KEY_GetCommonPropertiesCallback

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

Definition at line 33 of file CommandMap.php.

◆ KEY_GetElementPropertiesCallback

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

Definition at line 32 of file CommandMap.php.

◆ KEY_PurgeWithErrorMessageGetIdCallback

const TYPO3\CMS\Version\DataHandler\CommandMap::KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback'

Definition at line 37 of file CommandMap.php.

◆ KEY_ScopeErrorCode

const TYPO3\CMS\Version\DataHandler\CommandMap::KEY_ScopeErrorCode = 'KEY_ScopeErrorCode'

Definition at line 31 of file CommandMap.php.

◆ KEY_ScopeErrorMessage

const TYPO3\CMS\Version\DataHandler\CommandMap::KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage'

Definition at line 30 of file CommandMap.php.

◆ KEY_TransformDependentElementsToUseLiveId

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

Definition at line 39 of file CommandMap.php.

◆ KEY_UpdateGetIdCallback

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

Definition at line 38 of file CommandMap.php.

◆ SCOPE_WorkspacesClear

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

Definition at line 29 of file CommandMap.php.

◆ SCOPE_WorkspacesSetStage

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

Definition at line 28 of file CommandMap.php.

◆ SCOPE_WorkspacesSwap

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

Definition at line 27 of file CommandMap.php.