TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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=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 ( \TYPO3\CMS\Version\Hook\DataHandlerHook  $parent,
\TYPO3\CMS\Core\DataHandling\DataHandler  $tceMain,
array  $commandMap,
  $workspace 
)

Creates this object.

Parameters
\TYPO3\CMS\Version\Hook\DataHandlerHook$parent
\TYPO3\CMS\Core\DataHandling\DataHandler$tceMain
array$commandMap
int$workspace

Definition at line 94 of file CommandMap.php.

References CommandMap\$commandMap, CommandMap\$workspace, CommandMap\constructScopes(), CommandMap\getTceMain(), CommandMap\setParent(), CommandMap\setTceMain(), CommandMap\setWorkspace(), CommandMap\setWorkspacesChangeStageMode(), CommandMap\setWorkspacesConsiderReferences(), and CommandMap\setWorkspacesSwapMode().

Member Function Documentation

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\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 CommandMap\getParent().

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 elseif, CommandMap\getParent(), BackendUtility\getRecord(), CommandMap\getWorkspace(), GeneralUtility\inList(), CommandMap\mergeToBottom(), and GeneralUtility\trimExplode().

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 CommandMap\getParent(), and CommandMap\mergeToBottom().

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 CommandMap\__construct().

explodeSetStage (   $table,
  $versionIdList,
array  $properties 
)
protected

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

Exceptions
\RuntimeException
Parameters
string$table
string$versionIdList
array$properties
Returns
void

Definition at line 486 of file CommandMap.php.

References CommandMap\mergeToBottom(), and GeneralUtility\trimExplode().

get ( )

Gets the command map.

Returns
array

Definition at line 111 of file CommandMap.php.

References CommandMap\$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 ElementEntity\getDataValue().

getCommonSetStagePropertiesCallback ( ElementEntity  $element)
protected

Callback to get common properties of dependent elements for staging.

Parameters
ElementEntity$element
Returns
array

Definition at line 727 of file CommandMap.php.

References ElementEntity\getDataValue().

Referenced by CommandMap\getElementSetStagePropertiesCallback().

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 ElementEntity\getDataValue().

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

References CommandMap\getElementEntityProcessor(), and GeneralUtility\makeInstance().

getElementEntityProcessor ( )
protected

Gets the element entity processor.

Returns

Definition at line 236 of file CommandMap.php.

References CommandMap\$elementEntityProcessor, CommandMap\getWorkspace(), and GeneralUtility\makeInstance().

Referenced by CommandMap\getDependencyCallback().

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 ElementEntity\getId().

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 ElementEntity\getDataValue().

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 CommandMap\getCommonSetStagePropertiesCallback().

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 ElementEntity\getId().

getParent ( )
getScopeData (   $scope,
  $key 
)
protected

Gets data for a particular scope.

Exceptions
\RuntimeException
Parameters
string$scopeScope identifier
string$key
Returns
string

Definition at line 856 of file CommandMap.php.

getTceMain ( )

Gets the parent object.

Returns

Definition at line 155 of file CommandMap.php.

References CommandMap\$tceMain.

Referenced by CommandMap\__construct().

getWorkspace ( )

Gets the current workspace.

Returns
int

Definition at line 187 of file CommandMap.php.

References CommandMap\$workspace.

Referenced by CommandMap\applyWorkspacesSetStageBehaviour(), and CommandMap\getElementEntityProcessor().

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

Referenced by CommandMap\resolveWorkspacesSetStageDependencies().

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

Referenced by CommandMap\resolveWorkspacesSwapDependencies().

mergeToBottom ( array  $commandMap)
protected

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

Parameters
array$commandMap
Returns
void

Definition at line 611 of file CommandMap.php.

Referenced by CommandMap\applyWorkspacesSetStageBehaviour(), CommandMap\applyWorkspacesSwapBehaviour(), and CommandMap\explodeSetStage().

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 CommandMap\$commandMap.

process ( )
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.

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 ( )
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 CommandMap\process().

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 GeneralUtility\inList(), and CommandMap\invokeWorkspacesSetStageItems().

Referenced by CommandMap\process().

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 GeneralUtility\inList(), and CommandMap\invokeWorkspacesSwapItems().

Referenced by CommandMap\process().

set ( array  $commandMap)

Sets the command map.

Parameters
array$commandMap
Returns

Definition at line 122 of file CommandMap.php.

References CommandMap\$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 CommandMap\$parent.

Referenced by CommandMap\__construct().

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 CommandMap\$tceMain.

Referenced by CommandMap\__construct().

setWorkspace (   $workspace)

Sets the current workspace.

Parameters
int$workspace

Definition at line 177 of file CommandMap.php.

References CommandMap\$workspace.

Referenced by CommandMap\__construct().

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 CommandMap\$workspacesChangeStageMode.

Referenced by CommandMap\__construct().

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 CommandMap\$workspacesConsiderReferences.

Referenced by CommandMap\__construct().

setWorkspacesSwapMode (   $workspacesSwapMode)

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

Parameters
string$workspacesSwapMode
Returns

Definition at line 199 of file CommandMap.php.

References CommandMap\$workspacesSwapMode.

Referenced by CommandMap\__construct().

Member Data Documentation

$commandMap = array()
protected
$elementEntityProcessor
protected

Definition at line 84 of file CommandMap.php.

Referenced by CommandMap\getElementEntityProcessor().

$parent
protected

Definition at line 44 of file CommandMap.php.

Referenced by CommandMap\getParent(), and CommandMap\setParent().

$scopes
protected

Definition at line 79 of file CommandMap.php.

$tceMain
protected

Definition at line 49 of file CommandMap.php.

Referenced by CommandMap\getTceMain(), and CommandMap\setTceMain().

$workspace
protected
$workspacesChangeStageMode
protected

Definition at line 69 of file CommandMap.php.

Referenced by CommandMap\setWorkspacesChangeStageMode().

$workspacesConsiderReferences
protected

Definition at line 74 of file CommandMap.php.

Referenced by CommandMap\setWorkspacesConsiderReferences().

$workspacesSwapMode
protected

Definition at line 64 of file CommandMap.php.

Referenced by CommandMap\setWorkspacesSwapMode().

const KEY_ElementConstructCallback = 'KEY_EventConstructCallback'

Definition at line 34 of file CommandMap.php.

const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback'

Definition at line 35 of file CommandMap.php.

const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback'

Definition at line 36 of file CommandMap.php.

const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback'

Definition at line 33 of file CommandMap.php.

const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback'

Definition at line 32 of file CommandMap.php.

const KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback'

Definition at line 37 of file CommandMap.php.

const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode'

Definition at line 31 of file CommandMap.php.

const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage'

Definition at line 30 of file CommandMap.php.

const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId'

Definition at line 39 of file CommandMap.php.

const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback'

Definition at line 38 of file CommandMap.php.

const SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear'

Definition at line 29 of file CommandMap.php.

const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage'

Definition at line 28 of file CommandMap.php.

const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap'

Definition at line 27 of file CommandMap.php.