TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
CommandMap.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Version\DataHandler;
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 
267  protected function invokeWorkspacesSwapItems($callbackMethod, array $arguments = [])
268  {
269  // Traverses the cmd[] array and fetches the accordant actions:
270  foreach ($this->commandMap as $table => $liveIdCollection) {
271  foreach ($liveIdCollection as $liveId => $commandCollection) {
272  foreach ($commandCollection as $command => $properties) {
273  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'swap') {
274  if (isset($properties['swapWith']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($properties['swapWith'])) {
275  call_user_func_array([$this, $callbackMethod], array_merge($arguments, [$table, $liveId, $properties]));
276  }
277  }
278  }
279  }
280  }
281  }
282 
292  {
293  $scope = self::SCOPE_WorkspacesSwap;
294  $dependency = $this->getDependencyUtility($scope);
295  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages') {
296  $this->invokeWorkspacesSwapItems('applyWorkspacesSwapBehaviour');
297  }
298  $this->invokeWorkspacesSwapItems('addWorkspacesSwapElements', [$dependency]);
299  $this->applyWorkspacesDependencies($dependency, $scope);
300  }
301 
310  protected function applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
311  {
312  $extendedCommandMap = [];
313  $elementList = [];
314  // Fetch accordant elements if the swapMode is 'any' or 'pages':
315  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
316  $elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
317  }
318  foreach ($elementList as $elementTable => $elementIdArray) {
319  foreach ($elementIdArray as $elementIds) {
320  $extendedCommandMap[$elementTable][$elementIds[0]]['version'] = array_merge($properties, ['swapWith' => $elementIds[1]]);
321  }
322  }
323  if (!empty($elementList)) {
324  $this->remove($table, $liveId, 'version');
325  $this->mergeToBottom($extendedCommandMap);
326  }
327  }
328 
338  protected function addWorkspacesSwapElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $liveId, array $properties)
339  {
340  $elementList = [];
341  // Fetch accordant elements if the swapMode is 'any' or 'pages':
342  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
343  $elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
344  }
345  foreach ($elementList as $elementTable => $elementIdArray) {
346  foreach ($elementIdArray as $elementIds) {
347  $dependency->addElement($elementTable, $elementIds[1], ['liveId' => $elementIds[0], 'properties' => array_merge($properties, ['swapWith' => $elementIds[1]])]);
348  }
349  }
350  if (empty($elementList)) {
351  $dependency->addElement($table, $properties['swapWith'], ['liveId' => $liveId, 'properties' => $properties]);
352  }
353  }
354 
362  protected function invokeWorkspacesSetStageItems($callbackMethod, array $arguments = [])
363  {
364  // Traverses the cmd[] array and fetches the accordant actions:
365  foreach ($this->commandMap as $table => $versionIdCollection) {
366  foreach ($versionIdCollection as $versionIdList => $commandCollection) {
367  foreach ($commandCollection as $command => $properties) {
368  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
369  if (isset($properties['stageId']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($properties['stageId'])) {
370  call_user_func_array([$this, $callbackMethod], array_merge($arguments, [$table, $versionIdList, $properties]));
371  }
372  }
373  }
374  }
375  }
376  }
377 
386  {
387  $scope = self::SCOPE_WorkspacesSetStage;
388  $dependency = $this->getDependencyUtility($scope);
389  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
390  $this->invokeWorkspacesSetStageItems('applyWorkspacesSetStageBehaviour');
391  }
392  $this->invokeWorkspacesSetStageItems('explodeSetStage');
393  $this->invokeWorkspacesSetStageItems('addWorkspacesSetStageElements', [$dependency]);
394  $this->applyWorkspacesDependencies($dependency, $scope);
395  }
396 
405  protected function applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
406  {
407  $extendedCommandMap = [];
408  $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
409  $elementList = [$table => $versionIds];
410  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
411  if (count($versionIds) === 1) {
412  $workspaceRecord = BackendUtility::getRecord($table, $versionIds[0], 't3ver_wsid');
413  $workspaceId = $workspaceRecord['t3ver_wsid'];
414  } else {
415  $workspaceId = $this->getWorkspace();
416  }
417  if ($table === 'pages') {
418  // Find all elements from the same ws to change stage
419  $livePageIds = $versionIds;
420  $this->getParent()->findRealPageIds($livePageIds);
421  $this->getParent()->findPageElementsForVersionStageChange($livePageIds, $workspaceId, $elementList);
422  } elseif ($this->workspacesChangeStageMode === 'any') {
423  // Find page to change stage:
424  $pageIdList = [];
425  $this->getParent()->findPageIdsForVersionStateChange($table, $versionIds, $workspaceId, $pageIdList, $elementList);
426  // Find other elements from the same ws to change stage:
427  $this->getParent()->findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
428  }
429  }
430  foreach ($elementList as $elementTable => $elementIds) {
431  foreach ($elementIds as $elementId) {
432  $extendedCommandMap[$elementTable][$elementId]['version'] = $properties;
433  }
434  }
435  $this->remove($table, $versionIds, 'version');
436  $this->mergeToBottom($extendedCommandMap);
437  }
438 
448  protected function addWorkspacesSetStageElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $versionId, array $properties)
449  {
450  $dependency->addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
451  }
452 
461  {
462  $scope = self::SCOPE_WorkspacesClear;
463  $dependency = $this->getDependencyUtility($scope);
464  // Traverses the cmd[] array and fetches the accordant actions:
465  foreach ($this->commandMap as $table => $versionIdCollection) {
466  foreach ($versionIdCollection as $versionId => $commandCollection) {
467  foreach ($commandCollection as $command => $properties) {
468  if ($command === 'version' && isset($properties['action']) && ($properties['action'] === 'clearWSID' || $properties['action'] === 'flush')) {
469  $dependency->addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
470  }
471  }
472  }
473  }
474  $this->applyWorkspacesDependencies($dependency, $scope);
475  }
476 
486  protected function explodeSetStage($table, $versionIdList, array $properties)
487  {
488  $extractedCommandMap = [];
489  $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
490  if (count($versionIds) > 1) {
491  foreach ($versionIds as $versionId) {
492  if (isset($this->commandMap[$table][$versionId]['version'])) {
493  throw new \RuntimeException('Command map for [' . $table . '][' . $versionId . '][version] was already set.', 1289391048);
494  }
495  $extractedCommandMap[$table][$versionId]['version'] = $properties;
496  }
497  $this->remove($table, $versionIdList, 'version');
498  $this->mergeToBottom($extractedCommandMap);
499  }
500  }
501 
510  protected function applyWorkspacesDependencies(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $scope)
511  {
512  $transformDependentElementsToUseLiveId = $this->getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
513  $elementsToBeVersioned = $dependency->getElements();
514  // Use the uid of the live record instead of the workspace record:
515  if ($transformDependentElementsToUseLiveId) {
516  $elementsToBeVersioned = $this->getElementEntityProcessor()->transformDependentElementsToUseLiveId($elementsToBeVersioned);
517  }
518  $outerMostParents = $dependency->getOuterMostParents();
520  foreach ($outerMostParents as $outerMostParent) {
521  $dependentElements = $dependency->getNestedElements($outerMostParent);
522  if ($transformDependentElementsToUseLiveId) {
523  $dependentElements = $this->getElementEntityProcessor()->transformDependentElementsToUseLiveId($dependentElements);
524  }
525  // Gets the difference (intersection) between elements that were submitted by the user
526  // and the evaluation of all dependent records that should be used for this action instead:
527  $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersioned);
528  if (!empty($intersectingElements)) {
529  // If at least one element intersects but not all, throw away all elements of the depdendent structure:
530  if (count($intersectingElements) !== count($dependentElements) && $this->workspacesConsiderReferences === false) {
531  $this->purgeWithErrorMessage($intersectingElements, $scope);
532  } else {
533  $this->update(current($intersectingElements), $dependentElements, $scope);
534  }
535  }
536  }
537  }
538 
546  protected function purgeWithErrorMessage(array $elements, $scope)
547  {
549  foreach ($elements as $element) {
550  $table = $element->getTable();
551  $id = $this->processCallback($this->getScopeData($scope, self::KEY_PurgeWithErrorMessageGetIdCallback), [$element]);
552  $this->remove($table, $id, 'version');
553  $this->getTceMain()->log($table, $id, 5, 0, 1, $this->getScopeData($scope, self::KEY_ScopeErrorMessage), $this->getScopeData($scope, self::KEY_ScopeErrorCode), [
555  $table,
556  $id
557  ]);
558  }
559  }
560 
569  protected function update(ElementEntity $intersectingElement, array $elements, $scope)
570  {
571  $orderedCommandMap = [];
572  $commonProperties = [];
573  if ($this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback)) {
574  $commonProperties = $this->processCallback($this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback), [$intersectingElement]);
575  }
577  foreach ($elements as $element) {
578  $table = $element->getTable();
579  $id = $this->processCallback($this->getScopeData($scope, self::KEY_UpdateGetIdCallback), [$element]);
580  $this->remove($table, $id, 'version');
581  if ($element->isInvalid()) {
582  continue;
583  }
584  $orderedCommandMap[$table][$id]['version'] = $commonProperties;
585  if ($this->getScopeData($scope, self::KEY_GetElementPropertiesCallback)) {
586  $orderedCommandMap[$table][$id]['version'] = array_merge($commonProperties, $this->processCallback($this->getScopeData($scope, self::KEY_GetElementPropertiesCallback), [$element]));
587  }
588  }
589  // Ensure that ordered command map is on top of the command map:
590  $this->mergeToTop($orderedCommandMap);
591  }
592 
599  protected function mergeToTop(array $commandMap)
600  {
602  $this->commandMap = $commandMap;
603  }
604 
611  protected function mergeToBottom(array $commandMap)
612  {
614  }
615 
624  protected function remove($table, $id, $command = null)
625  {
626  if (is_string($command)) {
627  unset($this->commandMap[$table][$id][$command]);
628  } else {
629  unset($this->commandMap[$table][$id]);
630  }
631  }
632 
639  protected function getElementLiveIdCallback(ElementEntity $element)
640  {
641  return $element->getDataValue('liveId');
642  }
643 
650  protected function getElementIdCallback(ElementEntity $element)
651  {
652  return $element->getId();
653  }
654 
661  protected function getElementSwapPropertiesCallback(ElementEntity $element)
662  {
663  return [
664  'swapWith' => $element->getId()
665  ];
666  }
667 
674  protected function getCommonClearPropertiesCallback(ElementEntity $element)
675  {
676  $commonSwapProperties = [];
677  $elementProperties = $element->getDataValue('properties');
678  if (isset($elementProperties['action'])) {
679  $commonSwapProperties['action'] = $elementProperties['action'];
680  }
681  return $commonSwapProperties;
682  }
683 
690  protected function getCommonSwapPropertiesCallback(ElementEntity $element)
691  {
692  $commonSwapProperties = [];
693  $elementProperties = $element->getDataValue('properties');
694  if (isset($elementProperties['action'])) {
695  $commonSwapProperties['action'] = $elementProperties['action'];
696  }
697  if (isset($elementProperties['swapIntoWS'])) {
698  $commonSwapProperties['swapIntoWS'] = $elementProperties['swapIntoWS'];
699  }
700  if (isset($elementProperties['comment'])) {
701  $commonSwapProperties['comment'] = $elementProperties['comment'];
702  }
703  if (isset($elementProperties['notificationAlternativeRecipients'])) {
704  $commonSwapProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
705  }
706 
707  return $commonSwapProperties;
708  }
709 
717  {
718  return $this->getCommonSetStagePropertiesCallback($element);
719  }
720 
728  {
729  $commonSetStageProperties = [];
730  $elementProperties = $element->getDataValue('properties');
731  if (isset($elementProperties['stageId'])) {
732  $commonSetStageProperties['stageId'] = $elementProperties['stageId'];
733  }
734  if (isset($elementProperties['comment'])) {
735  $commonSetStageProperties['comment'] = $elementProperties['comment'];
736  }
737  if (isset($elementProperties['action'])) {
738  $commonSetStageProperties['action'] = $elementProperties['action'];
739  }
740  if (isset($elementProperties['notificationAlternativeRecipients'])) {
741  $commonSetStageProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
742  }
743  return $commonSetStageProperties;
744  }
745 
752  protected function getDependencyUtility($scope)
753  {
755  $dependency = GeneralUtility::makeInstance(\TYPO3\CMS\Version\Dependency\DependencyResolver::class);
756  $dependency->setWorkspace($this->getWorkspace());
757  $dependency->setOuterMostParentsRequireReferences(true);
758  if ($this->getScopeData($scope, self::KEY_ElementConstructCallback)) {
759  $dependency->setEventCallback(ElementEntity::EVENT_Construct, $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementConstructCallback)));
760  }
761  if ($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
762  $dependency->setEventCallback(ElementEntity::EVENT_CreateChildReference, $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)));
763  }
764  if ($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
765  $dependency->setEventCallback(ElementEntity::EVENT_CreateParentReference, $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)));
766  }
767  return $dependency;
768  }
769 
776  protected function constructScopes()
777  {
778  $this->scopes = [
779  // settings for publishing and swapping:
780  self::SCOPE_WorkspacesSwap => [
781  // error message and error code
782  self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be swapped or published independently, because it is related to other new or modified records.',
783  self::KEY_ScopeErrorCode => 1288283630,
784  // callback functons used to modify the commandMap
785  // + element properties are specific for each element
786  // + common properties are the same for all elements
787  self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
788  self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
789  // callback function used, when a new element to be checked is added
790  self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
791  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
792  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
793  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
794  // callback function used to get the correct record uid to be used in the error message
795  self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementLiveIdCallback',
796  // callback function used to fetch the correct record uid on modifying the commandMap
797  self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
798  // setting whether to use the uid of the live record instead of the workspace record
799  self::KEY_TransformDependentElementsToUseLiveId => true
800  ],
801  // settings for modifying the stage:
802  self::SCOPE_WorkspacesSetStage => [
803  // error message and error code
804  self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be sent to another stage independently, because it is related to other new or modified records.',
805  self::KEY_ScopeErrorCode => 1289342524,
806  // callback functons used to modify the commandMap
807  // + element properties are specific for each element
808  // + common properties are the same for all elements
809  self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
810  self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
811  // callback function used, when a new element to be checked is added
812  self::KEY_ElementConstructCallback => null,
813  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
814  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
815  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
816  // callback function used to get the correct record uid to be used in the error message
817  self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
818  // callback function used to fetch the correct record uid on modifying the commandMap
819  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
820  // setting whether to use the uid of the live record instead of the workspace record
821  self::KEY_TransformDependentElementsToUseLiveId => false
822  ],
823  // settings for clearing and flushing:
824  self::SCOPE_WorkspacesClear => [
825  // error message and error code
826  self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be flushed independently, because it is related to other new or modified records.',
827  self::KEY_ScopeErrorCode => 1300467990,
828  // callback functons used to modify the commandMap
829  // + element properties are specific for each element
830  // + common properties are the same for all elements
831  self::KEY_GetElementPropertiesCallback => null,
832  self::KEY_GetCommonPropertiesCallback => 'getCommonClearPropertiesCallback',
833  // callback function used, when a new element to be checked is added
834  self::KEY_ElementConstructCallback => null,
835  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
836  self::KEY_ElementCreateChildReferenceCallback => 'createClearDependentElementChildReferenceCallback',
837  self::KEY_ElementCreateParentReferenceCallback => 'createClearDependentElementParentReferenceCallback',
838  // callback function used to get the correct record uid to be used in the error message
839  self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
840  // callback function used to fetch the correct record uid on modifying the commandMap
841  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
842  // setting whether to use the uid of the live record instead of the workspace record
843  self::KEY_TransformDependentElementsToUseLiveId => false
844  ]
845  ];
846  }
847 
856  protected function getScopeData($scope, $key)
857  {
858  if (!isset($this->scopes[$scope])) {
859  throw new \RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
860  }
861  return $this->scopes[$scope][$key];
862  }
863 
871  protected function getDependencyCallback($method, array $targetArguments = [])
872  {
874  \TYPO3\CMS\Version\Dependency\EventCallback::class,
875  $this->getElementEntityProcessor(),
876  $method,
877  $targetArguments
878  );
879  }
880 
888  protected function processCallback($method, array $callbackArguments)
889  {
890  return call_user_func_array([$this, $method], $callbackArguments);
891  }
892 }
setWorkspacesConsiderReferences($workspacesConsiderReferences)
Definition: CommandMap.php:225
processCallback($method, array $callbackArguments)
Definition: CommandMap.php:888
invokeWorkspacesSwapItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:267
addWorkspacesSwapElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $liveId, array $properties)
Definition: CommandMap.php:338
__construct(\TYPO3\CMS\Version\Hook\DataHandlerHook $parent,\TYPO3\CMS\Core\DataHandling\DataHandler $tceMain, array $commandMap, $workspace)
Definition: CommandMap.php:94
setParent(\TYPO3\CMS\Version\Hook\DataHandlerHook $parent)
Definition: CommandMap.php:144
getElementIdCallback(ElementEntity $element)
Definition: CommandMap.php:650
applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
Definition: CommandMap.php:405
static trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
getElementSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:661
setTceMain(\TYPO3\CMS\Core\DataHandling\DataHandler $tceMain)
Definition: CommandMap.php:166
static getRecordTitle($table, $row, $prep=false, $forceResult=true)
getCommonClearPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:674
getCommonSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:727
setWorkspacesChangeStageMode($workspacesChangeStageMode)
Definition: CommandMap.php:212
addWorkspacesSetStageElements(\TYPO3\CMS\Version\Dependency\DependencyResolver $dependency, $table, $versionId, array $properties)
Definition: CommandMap.php:448
applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
Definition: CommandMap.php:310
static getRecord($table, $uid, $fields= '*', $where= '', $useDeleteClause=true)
getElementLiveIdCallback(ElementEntity $element)
Definition: CommandMap.php:639
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
invokeWorkspacesSetStageItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:362
getElementSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:716
explodeSetStage($table, $versionIdList, array $properties)
Definition: CommandMap.php:486
static makeInstance($className,...$constructorArguments)
getDependencyCallback($method, array $targetArguments=[])
Definition: CommandMap.php:871
getCommonSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:690
setWorkspacesSwapMode($workspacesSwapMode)
Definition: CommandMap.php:199