TYPO3 CMS  TYPO3_8-7
CommandMap.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
20 
26 {
27  const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap';
28  const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage';
29  const SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear';
30  const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage';
31  const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode';
32  const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback';
33  const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback';
34  const KEY_ElementConstructCallback = 'KEY_EventConstructCallback';
35  const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback';
36  const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback';
37  const KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback';
38  const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback';
39  const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId';
40 
44  protected $parent;
45 
49  protected $tceMain;
50 
54  protected $commandMap = [];
55 
59  protected $workspace;
60 
65 
70 
75 
79  protected $scopes;
80 
85 
94  public function __construct(\TYPO3\CMS\Version\Hook\DataHandlerHook $parent, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain, array $commandMap, $workspace)
95  {
96  $this->setParent($parent);
97  $this->setTceMain($tceMain);
98  $this->set($commandMap);
99  $this->setWorkspace($workspace);
100  $this->setWorkspacesSwapMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.swapMode'));
101  $this->setWorkspacesChangeStageMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.changeStageMode'));
102  $this->setWorkspacesConsiderReferences($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.considerReferences'));
103  $this->constructScopes();
104  }
105 
111  public function get()
112  {
113  return $this->commandMap;
114  }
115 
122  public function set(array $commandMap)
123  {
124  $this->commandMap = $commandMap;
125  return $this;
126  }
127 
133  public function getParent()
134  {
135  return $this->parent;
136  }
137 
144  public function setParent(\TYPO3\CMS\Version\Hook\DataHandlerHook $parent)
145  {
146  $this->parent = $parent;
147  return $this;
148  }
149 
155  public function getTceMain()
156  {
157  return $this->tceMain;
158  }
159 
166  public function setTceMain(\TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
167  {
168  $this->tceMain = $tceMain;
169  return $this;
170  }
171 
177  public function setWorkspace($workspace)
178  {
179  $this->workspace = (int)$workspace;
180  }
181 
187  public function getWorkspace()
188  {
189  return $this->workspace;
190  }
191 
200  {
201  $this->workspacesSwapMode = (string)$workspacesSwapMode;
202  return $this;
203  }
204 
213  {
214  $this->workspacesChangeStageMode = (string)$workspacesChangeStageMode;
215  return $this;
216  }
217 
226  {
227  $this->workspacesConsiderReferences = (bool)$workspacesConsiderReferences;
228  return $this;
229  }
230 
236  protected function getElementEntityProcessor()
237  {
238  if (!isset($this->elementEntityProcessor)) {
239  $this->elementEntityProcessor = GeneralUtility::makeInstance(
240  \TYPO3\CMS\Version\Dependency\ElementEntityProcessor::class
241  );
242  $this->elementEntityProcessor->setWorkspace($this->getWorkspace());
243  }
245  }
246 
252  public function process()
253  {
257  return $this;
258  }
259 
266  protected function invokeWorkspacesSwapItems($callbackMethod, array $arguments = [])
267  {
268  // Traverses the cmd[] array and fetches the accordant actions:
269  foreach ($this->commandMap as $table => $liveIdCollection) {
270  foreach ($liveIdCollection as $liveId => $commandCollection) {
271  foreach ($commandCollection as $command => $properties) {
272  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'swap') {
273  if (isset($properties['swapWith']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($properties['swapWith'])) {
274  call_user_func_array([$this, $callbackMethod], array_merge($arguments, [$table, $liveId, $properties]));
275  }
276  }
277  }
278  }
279  }
280  }
281 
289  {
290  $scope = self::SCOPE_WorkspacesSwap;
291  $dependency = $this->getDependencyUtility($scope);
292  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages') {
293  $this->invokeWorkspacesSwapItems('applyWorkspacesSwapBehaviour');
294  }
295  $this->invokeWorkspacesSwapItems('addWorkspacesSwapElements', [$dependency]);
296  $this->applyWorkspacesDependencies($dependency, $scope);
297  }
298 
306  protected function applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
307  {
308  $extendedCommandMap = [];
309  $elementList = [];
310  // Fetch accordant elements if the swapMode is 'any' or 'pages':
311  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
312  $elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
313  }
314  foreach ($elementList as $elementTable => $elementIdArray) {
315  foreach ($elementIdArray as $elementIds) {
316  $extendedCommandMap[$elementTable][$elementIds[0]]['version'] = array_merge($properties, ['swapWith' => $elementIds[1]]);
317  }
318  }
319  if (!empty($elementList)) {
320  $this->remove($table, $liveId, 'version');
321  $this->mergeToBottom($extendedCommandMap);
322  }
323  }
324 
333  protected function addWorkspacesSwapElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $liveId, array $properties)
334  {
335  $elementList = [];
336  // Fetch accordant elements if the swapMode is 'any' or 'pages':
337  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
338  $elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
339  }
340  foreach ($elementList as $elementTable => $elementIdArray) {
341  foreach ($elementIdArray as $elementIds) {
342  $dependency->addElement($elementTable, $elementIds[1], ['liveId' => $elementIds[0], 'properties' => array_merge($properties, ['swapWith' => $elementIds[1]])]);
343  }
344  }
345  if (empty($elementList)) {
346  $dependency->addElement($table, $properties['swapWith'], ['liveId' => $liveId, 'properties' => $properties]);
347  }
348  }
349 
356  protected function invokeWorkspacesSetStageItems($callbackMethod, array $arguments = [])
357  {
358  // Traverses the cmd[] array and fetches the accordant actions:
359  foreach ($this->commandMap as $table => $versionIdCollection) {
360  foreach ($versionIdCollection as $versionIdList => $commandCollection) {
361  foreach ($commandCollection as $command => $properties) {
362  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
363  if (isset($properties['stageId']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($properties['stageId'])) {
364  call_user_func_array([$this, $callbackMethod], array_merge($arguments, [$table, $versionIdList, $properties]));
365  }
366  }
367  }
368  }
369  }
370  }
371 
378  {
379  $scope = self::SCOPE_WorkspacesSetStage;
380  $dependency = $this->getDependencyUtility($scope);
381  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
382  $this->invokeWorkspacesSetStageItems('applyWorkspacesSetStageBehaviour');
383  }
384  $this->invokeWorkspacesSetStageItems('explodeSetStage');
385  $this->invokeWorkspacesSetStageItems('addWorkspacesSetStageElements', [$dependency]);
386  $this->applyWorkspacesDependencies($dependency, $scope);
387  }
388 
396  protected function applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
397  {
398  $extendedCommandMap = [];
399  $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
400  $elementList = [$table => $versionIds];
401  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
402  if (count($versionIds) === 1) {
403  $workspaceRecord = BackendUtility::getRecord($table, $versionIds[0], 't3ver_wsid');
404  $workspaceId = $workspaceRecord['t3ver_wsid'];
405  } else {
406  $workspaceId = $this->getWorkspace();
407  }
408  if ($table === 'pages') {
409  // Find all elements from the same ws to change stage
410  $livePageIds = $versionIds;
411  $this->getParent()->findRealPageIds($livePageIds);
412  $this->getParent()->findPageElementsForVersionStageChange($livePageIds, $workspaceId, $elementList);
413  } elseif ($this->workspacesChangeStageMode === 'any') {
414  // Find page to change stage:
415  $pageIdList = [];
416  $this->getParent()->findPageIdsForVersionStateChange($table, $versionIds, $workspaceId, $pageIdList, $elementList);
417  // Find other elements from the same ws to change stage:
418  $this->getParent()->findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
419  }
420  }
421  foreach ($elementList as $elementTable => $elementIds) {
422  foreach ($elementIds as $elementId) {
423  $extendedCommandMap[$elementTable][$elementId]['version'] = $properties;
424  }
425  }
426  $this->remove($table, $versionIds, 'version');
427  $this->mergeToBottom($extendedCommandMap);
428  }
429 
438  protected function addWorkspacesSetStageElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $versionId, array $properties)
439  {
440  $dependency->addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
441  }
442 
449  {
450  $scope = self::SCOPE_WorkspacesClear;
451  $dependency = $this->getDependencyUtility($scope);
452  // Traverses the cmd[] array and fetches the accordant actions:
453  foreach ($this->commandMap as $table => $versionIdCollection) {
454  foreach ($versionIdCollection as $versionId => $commandCollection) {
455  foreach ($commandCollection as $command => $properties) {
456  if ($command === 'version' && isset($properties['action']) && ($properties['action'] === 'clearWSID' || $properties['action'] === 'flush')) {
457  $dependency->addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
458  }
459  }
460  }
461  }
462  $this->applyWorkspacesDependencies($dependency, $scope);
463  }
464 
473  protected function explodeSetStage($table, $versionIdList, array $properties)
474  {
475  $extractedCommandMap = [];
476  $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
477  if (count($versionIds) > 1) {
478  foreach ($versionIds as $versionId) {
479  if (isset($this->commandMap[$table][$versionId]['version'])) {
480  throw new \RuntimeException('Command map for [' . $table . '][' . $versionId . '][version] was already set.', 1289391048);
481  }
482  $extractedCommandMap[$table][$versionId]['version'] = $properties;
483  }
484  $this->remove($table, $versionIdList, 'version');
485  $this->mergeToBottom($extractedCommandMap);
486  }
487  }
488 
496  protected function applyWorkspacesDependencies(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $scope)
497  {
498  $transformDependentElementsToUseLiveId = $this->getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
499  $elementsToBeVersioned = $dependency->getElements();
500  // Use the uid of the live record instead of the workspace record:
501  if ($transformDependentElementsToUseLiveId) {
502  $elementsToBeVersioned = $this->getElementEntityProcessor()->transformDependentElementsToUseLiveId($elementsToBeVersioned);
503  }
504  $outerMostParents = $dependency->getOuterMostParents();
506  foreach ($outerMostParents as $outerMostParent) {
507  $dependentElements = $dependency->getNestedElements($outerMostParent);
508  if ($transformDependentElementsToUseLiveId) {
509  $dependentElements = $this->getElementEntityProcessor()->transformDependentElementsToUseLiveId($dependentElements);
510  }
511  // Gets the difference (intersection) between elements that were submitted by the user
512  // and the evaluation of all dependent records that should be used for this action instead:
513  $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersioned);
514  if (!empty($intersectingElements)) {
515  // If at least one element intersects but not all, throw away all elements of the depdendent structure:
516  if (count($intersectingElements) !== count($dependentElements) && $this->workspacesConsiderReferences === false) {
517  $this->purgeWithErrorMessage($intersectingElements, $scope);
518  } else {
519  $this->update(current($intersectingElements), $dependentElements, $scope);
520  }
521  }
522  }
523  }
524 
531  protected function purgeWithErrorMessage(array $elements, $scope)
532  {
534  foreach ($elements as $element) {
535  $table = $element->getTable();
536  $id = $this->processCallback($this->getScopeData($scope, self::KEY_PurgeWithErrorMessageGetIdCallback), [$element]);
537  $this->remove($table, $id, 'version');
538  $this->getTceMain()->log($table, $id, 5, 0, 1, $this->getScopeData($scope, self::KEY_ScopeErrorMessage), $this->getScopeData($scope, self::KEY_ScopeErrorCode), [
540  $table,
541  $id
542  ]);
543  }
544  }
545 
553  protected function update(ElementEntity $intersectingElement, array $elements, $scope)
554  {
555  $orderedCommandMap = [];
556  $commonProperties = [];
557  if ($this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback)) {
558  $commonProperties = $this->processCallback($this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback), [$intersectingElement]);
559  }
561  foreach ($elements as $element) {
562  $table = $element->getTable();
563  $id = $this->processCallback($this->getScopeData($scope, self::KEY_UpdateGetIdCallback), [$element]);
564  $this->remove($table, $id, 'version');
565  if ($element->isInvalid()) {
566  continue;
567  }
568  $orderedCommandMap[$table][$id]['version'] = $commonProperties;
569  if ($this->getScopeData($scope, self::KEY_GetElementPropertiesCallback)) {
570  $orderedCommandMap[$table][$id]['version'] = array_merge($commonProperties, $this->processCallback($this->getScopeData($scope, self::KEY_GetElementPropertiesCallback), [$element]));
571  }
572  }
573  // Ensure that ordered command map is on top of the command map:
574  $this->mergeToTop($orderedCommandMap);
575  }
576 
582  protected function mergeToTop(array $commandMap)
583  {
585  $this->commandMap = $commandMap;
586  }
587 
593  protected function mergeToBottom(array $commandMap)
594  {
596  }
597 
605  protected function remove($table, $id, $command = null)
606  {
607  if (is_string($command)) {
608  unset($this->commandMap[$table][$id][$command]);
609  } else {
610  unset($this->commandMap[$table][$id]);
611  }
612  }
613 
620  protected function getElementLiveIdCallback(ElementEntity $element)
621  {
622  return $element->getDataValue('liveId');
623  }
624 
631  protected function getElementIdCallback(ElementEntity $element)
632  {
633  return $element->getId();
634  }
635 
642  protected function getElementSwapPropertiesCallback(ElementEntity $element)
643  {
644  return [
645  'swapWith' => $element->getId()
646  ];
647  }
648 
655  protected function getCommonClearPropertiesCallback(ElementEntity $element)
656  {
657  $commonSwapProperties = [];
658  $elementProperties = $element->getDataValue('properties');
659  if (isset($elementProperties['action'])) {
660  $commonSwapProperties['action'] = $elementProperties['action'];
661  }
662  return $commonSwapProperties;
663  }
664 
671  protected function getCommonSwapPropertiesCallback(ElementEntity $element)
672  {
673  $commonSwapProperties = [];
674  $elementProperties = $element->getDataValue('properties');
675  if (isset($elementProperties['action'])) {
676  $commonSwapProperties['action'] = $elementProperties['action'];
677  }
678  if (isset($elementProperties['swapIntoWS'])) {
679  $commonSwapProperties['swapIntoWS'] = $elementProperties['swapIntoWS'];
680  }
681  if (isset($elementProperties['comment'])) {
682  $commonSwapProperties['comment'] = $elementProperties['comment'];
683  }
684  if (isset($elementProperties['notificationAlternativeRecipients'])) {
685  $commonSwapProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
686  }
687 
688  return $commonSwapProperties;
689  }
690 
698  {
699  return $this->getCommonSetStagePropertiesCallback($element);
700  }
701 
709  {
710  $commonSetStageProperties = [];
711  $elementProperties = $element->getDataValue('properties');
712  if (isset($elementProperties['stageId'])) {
713  $commonSetStageProperties['stageId'] = $elementProperties['stageId'];
714  }
715  if (isset($elementProperties['comment'])) {
716  $commonSetStageProperties['comment'] = $elementProperties['comment'];
717  }
718  if (isset($elementProperties['action'])) {
719  $commonSetStageProperties['action'] = $elementProperties['action'];
720  }
721  if (isset($elementProperties['notificationAlternativeRecipients'])) {
722  $commonSetStageProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
723  }
724  return $commonSetStageProperties;
725  }
726 
733  protected function getDependencyUtility($scope)
734  {
736  $dependency = GeneralUtility::makeInstance(\TYPO3\CMS\Version\Dependency\DependencyResolver::class);
737  $dependency->setWorkspace($this->getWorkspace());
738  $dependency->setOuterMostParentsRequireReferences(true);
739  if ($this->getScopeData($scope, self::KEY_ElementConstructCallback)) {
740  $dependency->setEventCallback(ElementEntity::EVENT_Construct, $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementConstructCallback)));
741  }
742  if ($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
743  $dependency->setEventCallback(ElementEntity::EVENT_CreateChildReference, $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)));
744  }
745  if ($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
746  $dependency->setEventCallback(ElementEntity::EVENT_CreateParentReference, $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)));
747  }
748  return $dependency;
749  }
750 
755  protected function constructScopes()
756  {
757  $this->scopes = [
758  // settings for publishing and swapping:
759  self::SCOPE_WorkspacesSwap => [
760  // error message and error code
761  self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be swapped or published independently, because it is related to other new or modified records.',
762  self::KEY_ScopeErrorCode => 1288283630,
763  // callback functons used to modify the commandMap
764  // + element properties are specific for each element
765  // + common properties are the same for all elements
766  self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
767  self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
768  // callback function used, when a new element to be checked is added
769  self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
770  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
771  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
772  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
773  // callback function used to get the correct record uid to be used in the error message
774  self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementLiveIdCallback',
775  // callback function used to fetch the correct record uid on modifying the commandMap
776  self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
777  // setting whether to use the uid of the live record instead of the workspace record
778  self::KEY_TransformDependentElementsToUseLiveId => true
779  ],
780  // settings for modifying the stage:
781  self::SCOPE_WorkspacesSetStage => [
782  // error message and error code
783  self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be sent to another stage independently, because it is related to other new or modified records.',
784  self::KEY_ScopeErrorCode => 1289342524,
785  // callback functons used to modify the commandMap
786  // + element properties are specific for each element
787  // + common properties are the same for all elements
788  self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
789  self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
790  // callback function used, when a new element to be checked is added
791  self::KEY_ElementConstructCallback => null,
792  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
793  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
794  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
795  // callback function used to get the correct record uid to be used in the error message
796  self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
797  // callback function used to fetch the correct record uid on modifying the commandMap
798  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
799  // setting whether to use the uid of the live record instead of the workspace record
800  self::KEY_TransformDependentElementsToUseLiveId => false
801  ],
802  // settings for clearing and flushing:
803  self::SCOPE_WorkspacesClear => [
804  // error message and error code
805  self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be flushed independently, because it is related to other new or modified records.',
806  self::KEY_ScopeErrorCode => 1300467990,
807  // callback functons used to modify the commandMap
808  // + element properties are specific for each element
809  // + common properties are the same for all elements
810  self::KEY_GetElementPropertiesCallback => null,
811  self::KEY_GetCommonPropertiesCallback => 'getCommonClearPropertiesCallback',
812  // callback function used, when a new element to be checked is added
813  self::KEY_ElementConstructCallback => null,
814  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
815  self::KEY_ElementCreateChildReferenceCallback => 'createClearDependentElementChildReferenceCallback',
816  self::KEY_ElementCreateParentReferenceCallback => 'createClearDependentElementParentReferenceCallback',
817  // callback function used to get the correct record uid to be used in the error message
818  self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
819  // callback function used to fetch the correct record uid on modifying the commandMap
820  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
821  // setting whether to use the uid of the live record instead of the workspace record
822  self::KEY_TransformDependentElementsToUseLiveId => false
823  ]
824  ];
825  }
826 
835  protected function getScopeData($scope, $key)
836  {
837  if (!isset($this->scopes[$scope])) {
838  throw new \RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
839  }
840  return $this->scopes[$scope][$key];
841  }
842 
850  protected function getDependencyCallback($method, array $targetArguments = [])
851  {
853  \TYPO3\CMS\Version\Dependency\EventCallback::class,
854  $this->getElementEntityProcessor(),
855  $method,
856  $targetArguments
857  );
858  }
859 
867  protected function processCallback($method, array $callbackArguments)
868  {
869  return call_user_func_array([$this, $method], $callbackArguments);
870  }
871 }
getCommonSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:708
applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
Definition: CommandMap.php:396
getElementSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:642
addWorkspacesSwapElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $liveId, array $properties)
Definition: CommandMap.php:333
addWorkspacesSetStageElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $versionId, array $properties)
Definition: CommandMap.php:438
setWorkspacesChangeStageMode($workspacesChangeStageMode)
Definition: CommandMap.php:212
getDependencyCallback($method, array $targetArguments=[])
Definition: CommandMap.php:850
invokeWorkspacesSwapItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:266
getElementIdCallback(ElementEntity $element)
Definition: CommandMap.php:631
setWorkspacesSwapMode($workspacesSwapMode)
Definition: CommandMap.php:199
__construct(\TYPO3\CMS\Version\Hook\DataHandlerHook $parent, \TYPO3\CMS\Core\DataHandling\DataHandler $tceMain, array $commandMap, $workspace)
Definition: CommandMap.php:94
static trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
processCallback($method, array $callbackArguments)
Definition: CommandMap.php:867
setWorkspacesConsiderReferences($workspacesConsiderReferences)
Definition: CommandMap.php:225
static makeInstance($className,... $constructorArguments)
getElementSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:697
explodeSetStage($table, $versionIdList, array $properties)
Definition: CommandMap.php:473
applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
Definition: CommandMap.php:306
getCommonClearPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:655
setParent(\TYPO3\CMS\Version\Hook\DataHandlerHook $parent)
Definition: CommandMap.php:144
getElementLiveIdCallback(ElementEntity $element)
Definition: CommandMap.php:620
static getRecordTitle($table, $row, $prep=false, $forceResult=true)
invokeWorkspacesSetStageItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:356
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
static getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
getCommonSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:671
setTceMain(\TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
Definition: CommandMap.php:166