TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Version\DataHandler\CommandMap Class Reference
Inheritance diagram for TYPO3\CMS\Version\DataHandler\CommandMap:
tx_version_tcemain_CommandMap

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=array())
 
 resolveWorkspacesSwapDependencies ()
 
 applyWorkspacesSwapBehaviour ($table, $liveId, array $properties)
 
 addWorkspacesSwapElements (\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $liveId, array $properties)
 
 invokeWorkspacesSetStageItems ($callbackMethod, array $arguments=array())
 
 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=array())
 
 processCallback ($method, array $callbackArguments)
 

Protected Attributes

 $parent
 
 $tceMain
 
 $commandMap = array()
 
 $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 427 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
integer$liveId
array$properties
Returns
void

Definition at line 321 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 385 of file CommandMap.php.

References TYPO3\CMS\Version\DataHandler\CommandMap\getParent(), TYPO3\CMS\Version\DataHandler\CommandMap\getWorkspace(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), 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
integer$liveId
array$properties
Returns
void

Definition at line 294 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 738 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 110 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 641 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 656 of file CommandMap.php.

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

◆ getDependencyCallback()

TYPO3\CMS\Version\DataHandler\CommandMap::getDependencyCallback (   $method,
array  $targetArguments = array() 
)
protected

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

Parameters
string$method
array$targetArguments
Returns

Definition at line 831 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
integer

Definition at line 619 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
integer

Definition at line 609 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 681 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 629 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 = array() 
)
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 344 of file CommandMap.php.

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

◆ invokeWorkspacesSwapItems()

TYPO3\CMS\Version\DataHandler\CommandMap::invokeWorkspacesSwapItems (   $callbackMethod,
array  $arguments = array() 
)
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 253 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 572 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 845 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 595 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 438 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 366 of file CommandMap.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\inList(), and 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 276 of file CommandMap.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\inList(), and 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 120 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 140 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 160 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 170 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 202 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
boolean$workspacesConsiderReferences
Returns

Definition at line 214 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 190 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.