‪TYPO3CMS  9.5
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 
27 
33 {
34  const ‪SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap';
35  const ‪SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage';
36  const ‪SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear';
37  const ‪KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback';
38  const ‪KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback';
39  const ‪KEY_ElementConstructCallback = 'KEY_EventConstructCallback';
40  const ‪KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback';
41  const ‪KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback';
42  const ‪KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback';
43  const ‪KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId';
44 
48  protected ‪$parent;
49 
53  protected ‪$tceMain;
54 
58  protected ‪$commandMap = [];
59 
63  protected ‪$workspace;
64 
68  protected ‪$workspacesSwapMode;
69 
74 
78  protected ‪$scopes;
79 
84 
94  {
95  $this->‪setParent($parent);
96  $this->‪setTceMain($tceMain);
97  $this->set(‪$commandMap);
99  $this->‪setWorkspacesSwapMode($this->‪getTceMain()->BE_USER->getTSConfig()['options.']['workspaces.']['swapMode'] ?? '');
100  $this->‪setWorkspacesChangeStageMode($this->‪getTceMain()->BE_USER->getTSConfig()['options.']['workspaces.']['changeStageMode'] ?? '');
102  }
103 
109  public function get()
110  {
111  return ‪$this->commandMap;
112  }
113 
120  public function set(array ‪$commandMap)
121  {
122  $this->commandMap = ‪$commandMap;
123  return $this;
124  }
125 
131  public function ‪getParent()
132  {
133  return ‪$this->parent;
134  }
135 
143  {
144  $this->parent = ‪$parent;
145  return $this;
146  }
147 
153  public function ‪getTceMain()
154  {
155  return ‪$this->tceMain;
156  }
157 
164  public function ‪setTceMain(‪DataHandler ‪$tceMain)
165  {
166  $this->tceMain = ‪$tceMain;
167  return $this;
168  }
169 
175  public function ‪setWorkspace(‪$workspace)
176  {
177  $this->workspace = (int)‪$workspace;
178  }
179 
185  public function ‪getWorkspace()
186  {
187  return ‪$this->workspace;
188  }
189 
198  {
199  $this->workspacesSwapMode = (string)‪$workspacesSwapMode;
200  return $this;
201  }
202 
211  {
212  $this->workspacesChangeStageMode = (string)‪$workspacesChangeStageMode;
213  return $this;
214  }
215 
221  protected function ‪getElementEntityProcessor()
222  {
223  if (!isset($this->elementEntityProcessor)) {
224  $this->elementEntityProcessor = GeneralUtility::makeInstance(ElementEntityProcessor::class);
225  $this->elementEntityProcessor->setWorkspace($this->‪getWorkspace());
226  }
228  }
229 
235  public function ‪process()
236  {
240  return $this;
241  }
242 
249  protected function ‪invokeWorkspacesSwapItems($callbackMethod, array $arguments = [])
250  {
251  // Traverses the cmd[] array and fetches the accordant actions:
252  foreach ($this->commandMap as $table => $liveIdCollection) {
253  foreach ($liveIdCollection as $liveId => $commandCollection) {
254  foreach ($commandCollection as $command => $properties) {
255  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'swap') {
256  if (isset($properties['swapWith']) && ‪MathUtility::canBeInterpretedAsInteger($properties['swapWith'])) {
257  call_user_func_array([$this, $callbackMethod], array_merge($arguments, [$table, $liveId, $properties]));
258  }
259  }
260  }
261  }
262  }
263  }
264 
271  protected function ‪resolveWorkspacesSwapDependencies()
272  {
274  $dependency = $this->‪getDependencyUtility($scope);
275  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages') {
276  $this->‪invokeWorkspacesSwapItems('applyWorkspacesSwapBehaviour');
277  }
278  $this->‪invokeWorkspacesSwapItems('addWorkspacesSwapElements', [$dependency]);
279  $this->‪applyWorkspacesDependencies($dependency, $scope);
280  }
281 
289  protected function ‪applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
290  {
291  $extendedCommandMap = [];
292  $elementList = [];
293  // Fetch accordant elements if the swapMode is 'any' or 'pages':
294  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
295  $elementList = $this->‪getParent()->‪findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
296  }
297  foreach ($elementList as $elementTable => $elementIdArray) {
298  foreach ($elementIdArray as $elementIds) {
299  $extendedCommandMap[$elementTable][$elementIds[0]]['version'] = array_merge($properties, ['swapWith' => $elementIds[1]]);
300  }
301  }
302  if (!empty($elementList)) {
303  $this->remove($table, $liveId, 'version');
304  $this->‪mergeToBottom($extendedCommandMap);
305  }
306  }
307 
316  protected function ‪addWorkspacesSwapElements(‪DependencyResolver $dependency, $table, $liveId, array $properties)
317  {
318  $elementList = [];
319  // Fetch accordant elements if the swapMode is 'any' or 'pages':
320  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
321  $elementList = $this->‪getParent()->‪findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
322  }
323  foreach ($elementList as $elementTable => $elementIdArray) {
324  foreach ($elementIdArray as $elementIds) {
325  $dependency->‪addElement($elementTable, $elementIds[1], ['liveId' => $elementIds[0], 'properties' => array_merge($properties, ['swapWith' => $elementIds[1]])]);
326  }
327  }
328  if (empty($elementList)) {
329  $dependency->‪addElement($table, $properties['swapWith'], ['liveId' => $liveId, 'properties' => $properties]);
330  }
331  }
332 
339  protected function ‪invokeWorkspacesSetStageItems($callbackMethod, array $arguments = [])
340  {
341  // Traverses the cmd[] array and fetches the accordant actions:
342  foreach ($this->commandMap as $table => $versionIdCollection) {
343  foreach ($versionIdCollection as $versionIdList => $commandCollection) {
344  foreach ($commandCollection as $command => $properties) {
345  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
346  if (isset($properties['stageId']) && ‪MathUtility::canBeInterpretedAsInteger($properties['stageId'])) {
347  call_user_func_array([$this, $callbackMethod], array_merge($arguments, [$table, $versionIdList, $properties]));
348  }
349  }
350  }
351  }
352  }
353  }
354 
360  protected function ‪resolveWorkspacesSetStageDependencies()
361  {
363  $dependency = $this->‪getDependencyUtility($scope);
364  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
365  $this->‪invokeWorkspacesSetStageItems('applyWorkspacesSetStageBehaviour');
366  }
367  $this->‪invokeWorkspacesSetStageItems('explodeSetStage');
368  $this->‪invokeWorkspacesSetStageItems('addWorkspacesSetStageElements', [$dependency]);
369  $this->‪applyWorkspacesDependencies($dependency, $scope);
370  }
371 
379  protected function ‪applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
380  {
381  $extendedCommandMap = [];
382  $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
383  $elementList = [$table => $versionIds];
384  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
385  if (count($versionIds) === 1) {
386  $workspaceRecord = ‪BackendUtility::getRecord($table, $versionIds[0], 't3ver_wsid');
387  $workspaceId = $workspaceRecord['t3ver_wsid'];
388  } else {
389  $workspaceId = $this->‪getWorkspace();
390  }
391  if ($table === 'pages') {
392  // Find all elements from the same ws to change stage
393  $livePageIds = $versionIds;
394  $this->‪getParent()->‪findRealPageIds($livePageIds);
395  $this->‪getParent()->‪findPageElementsForVersionStageChange($livePageIds, $workspaceId, $elementList);
396  } elseif ($this->workspacesChangeStageMode === 'any') {
397  // Find page to change stage:
398  $pageIdList = [];
399  $this->‪getParent()->‪findPageIdsForVersionStateChange($table, $versionIds, $workspaceId, $pageIdList, $elementList);
400  // Find other elements from the same ws to change stage:
401  $this->‪getParent()->‪findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
402  }
403  }
404  foreach ($elementList as $elementTable => $elementIds) {
405  foreach ($elementIds as $elementId) {
406  $extendedCommandMap[$elementTable][$elementId]['version'] = $properties;
407  }
408  }
409  foreach ($versionIds as $versionId) {
410  $this->remove($table, $versionId, 'version');
411  }
412  $this->‪mergeToBottom($extendedCommandMap);
413  }
414 
423  protected function ‪addWorkspacesSetStageElements(‪DependencyResolver $dependency, $table, $versionId, array $properties)
424  {
425  $dependency->‪addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
426  }
427 
433  protected function ‪resolveWorkspacesClearDependencies()
434  {
436  $dependency = $this->‪getDependencyUtility($scope);
437  // Traverses the cmd[] array and fetches the accordant actions:
438  foreach ($this->commandMap as $table => $versionIdCollection) {
439  foreach ($versionIdCollection as $versionId => $commandCollection) {
440  foreach ($commandCollection as $command => $properties) {
441  if ($command === 'version' && isset($properties['action']) && ($properties['action'] === 'clearWSID' || $properties['action'] === 'flush')) {
442  $dependency->‪addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
443  }
444  }
445  }
446  }
447  $this->‪applyWorkspacesDependencies($dependency, $scope);
448  }
449 
458  protected function ‪explodeSetStage($table, $versionIdList, array $properties)
459  {
460  $extractedCommandMap = [];
461  $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
462  if (count($versionIds) > 1) {
463  foreach ($versionIds as $versionId) {
464  if (isset($this->commandMap[$table][$versionId]['version'])) {
465  throw new \RuntimeException('Command map for [' . $table . '][' . $versionId . '][version] was already set.', 1289391048);
466  }
467  $extractedCommandMap[$table][$versionId]['version'] = $properties;
468  $this->remove($table, $versionId, 'version');
469  }
470  $this->‪mergeToBottom($extractedCommandMap);
471  }
472  }
473 
481  protected function ‪applyWorkspacesDependencies(‪DependencyResolver $dependency, $scope)
482  {
483  $transformDependentElementsToUseLiveId = $this->‪getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
484  $elementsToBeVersioned = $dependency->‪getElements();
485  // Use the uid of the live record instead of the workspace record:
486  if ($transformDependentElementsToUseLiveId) {
487  $elementsToBeVersioned = $this->‪getElementEntityProcessor()->‪transformDependentElementsToUseLiveId($elementsToBeVersioned);
488  }
489  $outerMostParents = $dependency->‪getOuterMostParents();
491  foreach ($outerMostParents as $outerMostParent) {
492  $dependentElements = $dependency->‪getNestedElements($outerMostParent);
493  if ($transformDependentElementsToUseLiveId) {
494  $dependentElements = $this->‪getElementEntityProcessor()->‪transformDependentElementsToUseLiveId($dependentElements);
495  }
496  // Gets the difference (intersection) between elements that were submitted by the user
497  // and the evaluation of all dependent records that should be used for this action instead:
498  $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersioned);
499  if (!empty($intersectingElements)) {
500  $this->‪update(current($intersectingElements), $dependentElements, $scope);
501  }
502  }
503  }
504 
512  protected function ‪update(‪ElementEntity $intersectingElement, array $elements, $scope)
513  {
514  $orderedCommandMap = [];
515  $commonProperties = [];
516  if ($this->‪getScopeData($scope, self::KEY_GetCommonPropertiesCallback)) {
517  $commonProperties = $this->‪processCallback($this->‪getScopeData($scope, self::KEY_GetCommonPropertiesCallback), [$intersectingElement]);
518  }
520  foreach ($elements as $element) {
521  $table = $element->getTable();
522  $id = $this->‪processCallback($this->‪getScopeData($scope, self::KEY_UpdateGetIdCallback), [$element]);
523  $this->remove($table, $id, 'version');
524  if ($element->isInvalid()) {
525  continue;
526  }
527  $orderedCommandMap[$table][$id]['version'] = $commonProperties;
528  if ($this->‪getScopeData($scope, self::KEY_GetElementPropertiesCallback)) {
529  $orderedCommandMap[$table][$id]['version'] = array_merge($commonProperties, $this->‪processCallback($this->‪getScopeData($scope, self::KEY_GetElementPropertiesCallback), [$element]));
530  }
531  }
532  // Ensure that ordered command map is on top of the command map:
533  $this->‪mergeToTop($orderedCommandMap);
534  }
535 
541  protected function ‪mergeToTop(array ‪$commandMap)
542  {
544  $this->commandMap = ‪$commandMap;
545  }
546 
552  protected function ‪mergeToBottom(array ‪$commandMap)
553  {
555  }
556 
564  protected function remove($table, $id, $command = null)
565  {
566  if (is_string($command)) {
567  unset($this->commandMap[$table][$id][$command]);
568  } else {
569  unset($this->commandMap[$table][$id]);
570  }
571  }
572 
579  protected function ‪getElementLiveIdCallback(‪ElementEntity $element)
580  {
581  return $element->‪getDataValue('liveId');
582  }
583 
590  protected function ‪getElementIdCallback(‪ElementEntity $element)
591  {
592  return $element->‪getId();
593  }
594 
601  protected function ‪getElementSwapPropertiesCallback(‪ElementEntity $element)
602  {
603  return [
604  'swapWith' => $element->‪getId()
605  ];
606  }
607 
614  protected function ‪getCommonClearPropertiesCallback(‪ElementEntity $element)
615  {
616  $commonSwapProperties = [];
617  $elementProperties = $element->‪getDataValue('properties');
618  if (isset($elementProperties['action'])) {
619  $commonSwapProperties['action'] = $elementProperties['action'];
620  }
621  return $commonSwapProperties;
622  }
623 
630  protected function ‪getCommonSwapPropertiesCallback(‪ElementEntity $element)
631  {
632  $commonSwapProperties = [];
633  $elementProperties = $element->‪getDataValue('properties');
634  if (isset($elementProperties['action'])) {
635  $commonSwapProperties['action'] = $elementProperties['action'];
636  }
637  if (isset($elementProperties['swapIntoWS'])) {
638  $commonSwapProperties['swapIntoWS'] = $elementProperties['swapIntoWS'];
639  }
640  if (isset($elementProperties['comment'])) {
641  $commonSwapProperties['comment'] = $elementProperties['comment'];
642  }
643  if (isset($elementProperties['notificationAlternativeRecipients'])) {
644  $commonSwapProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
645  }
646 
647  return $commonSwapProperties;
648  }
649 
656  protected function ‪getElementSetStagePropertiesCallback(‪ElementEntity $element)
657  {
658  return $this->‪getCommonSetStagePropertiesCallback($element);
659  }
660 
667  protected function ‪getCommonSetStagePropertiesCallback(‪ElementEntity $element)
668  {
669  $commonSetStageProperties = [];
670  $elementProperties = $element->‪getDataValue('properties');
671  if (isset($elementProperties['stageId'])) {
672  $commonSetStageProperties['stageId'] = $elementProperties['stageId'];
673  }
674  if (isset($elementProperties['comment'])) {
675  $commonSetStageProperties['comment'] = $elementProperties['comment'];
676  }
677  if (isset($elementProperties['action'])) {
678  $commonSetStageProperties['action'] = $elementProperties['action'];
679  }
680  if (isset($elementProperties['notificationAlternativeRecipients'])) {
681  $commonSetStageProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
682  }
683  return $commonSetStageProperties;
684  }
685 
692  protected function ‪getDependencyUtility($scope)
693  {
694  $dependency = GeneralUtility::makeInstance(DependencyResolver::class);
695  $dependency->‪setWorkspace($this->‪getWorkspace());
696  $dependency->‪setOuterMostParentsRequireReferences(true);
697  if ($this->‪getScopeData($scope, self::KEY_ElementConstructCallback)) {
698  $dependency->‪setEventCallback(‪ElementEntity::EVENT_Construct, $this->‪getDependencyCallback($this->‪getScopeData($scope, self::KEY_ElementConstructCallback)));
699  }
700  if ($this->‪getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
701  $dependency->‪setEventCallback(‪ElementEntity::EVENT_CreateChildReference, $this->‪getDependencyCallback($this->‪getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)));
702  }
703  if ($this->‪getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
704  $dependency->‪setEventCallback(‪ElementEntity::EVENT_CreateParentReference, $this->‪getDependencyCallback($this->‪getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)));
705  }
706  return $dependency;
707  }
708 
713  protected function ‪constructScopes()
714  {
715  $this->scopes = [
716  // settings for publishing and swapping:
717  self::SCOPE_WorkspacesSwap => [
718  // callback functons used to modify the commandMap
719  // + element properties are specific for each element
720  // + common properties are the same for all elements
721  self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
722  self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
723  // callback function used, when a new element to be checked is added
724  self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
725  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
726  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
727  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
728  // callback function used to fetch the correct record uid on modifying the commandMap
729  self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
730  // setting whether to use the uid of the live record instead of the workspace record
731  self::KEY_TransformDependentElementsToUseLiveId => true
732  ],
733  // settings for modifying the stage:
734  self::SCOPE_WorkspacesSetStage => [
735  // callback functons used to modify the commandMap
736  // + element properties are specific for each element
737  // + common properties are the same for all elements
738  self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
739  self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
740  // callback function used, when a new element to be checked is added
741  self::KEY_ElementConstructCallback => null,
742  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
743  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
744  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
745  // callback function used to fetch the correct record uid on modifying the commandMap
746  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
747  // setting whether to use the uid of the live record instead of the workspace record
748  self::KEY_TransformDependentElementsToUseLiveId => false
749  ],
750  // settings for clearing and flushing:
751  self::SCOPE_WorkspacesClear => [
752  // callback functons used to modify the commandMap
753  // + element properties are specific for each element
754  // + common properties are the same for all elements
755  self::KEY_GetElementPropertiesCallback => null,
756  self::KEY_GetCommonPropertiesCallback => 'getCommonClearPropertiesCallback',
757  // callback function used, when a new element to be checked is added
758  self::KEY_ElementConstructCallback => null,
759  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
760  self::KEY_ElementCreateChildReferenceCallback => 'createClearDependentElementChildReferenceCallback',
761  self::KEY_ElementCreateParentReferenceCallback => 'createClearDependentElementParentReferenceCallback',
762  // callback function used to fetch the correct record uid on modifying the commandMap
763  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
764  // setting whether to use the uid of the live record instead of the workspace record
765  self::KEY_TransformDependentElementsToUseLiveId => false
766  ]
767  ];
768  }
769 
778  protected function ‪getScopeData($scope, $key)
779  {
780  if (!isset($this->scopes[$scope])) {
781  throw new \RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
782  }
783  return $this->scopes[$scope][$key];
784  }
785 
793  protected function ‪getDependencyCallback($method, array $targetArguments = [])
794  {
795  return GeneralUtility::makeInstance(
796  EventCallback::class,
798  $method,
799  $targetArguments
800  );
801  }
802 
810  protected function ‪processCallback($method, array $callbackArguments)
811  {
812  return call_user_func_array([$this, $method], $callbackArguments);
813  }
814 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:81
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\getDataValue
‪mixed getDataValue($key)
Definition: ElementEntity.php:155
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\constructScopes
‪constructScopes()
Definition: CommandMap.php:705
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonSwapPropertiesCallback
‪array getCommonSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:622
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToTop
‪mergeToTop(array $commandMap)
Definition: CommandMap.php:533
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\getId
‪int getId()
Definition: ElementEntity.php:124
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:73
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook
Definition: DataHandlerHook.php:47
‪TYPO3\CMS\Workspaces\DataHandler
Definition: CommandMap.php:2
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getTceMain
‪DataHandler getTceMain()
Definition: CommandMap.php:145
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_GetCommonPropertiesCallback
‪const KEY_GetCommonPropertiesCallback
Definition: CommandMap.php:38
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesSwap
‪const SCOPE_WorkspacesSwap
Definition: CommandMap.php:34
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\invokeWorkspacesSwapItems
‪invokeWorkspacesSwapItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:241
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getScopeData
‪string getScopeData($scope, $key)
Definition: CommandMap.php:770
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$elementEntityProcessor
‪ElementEntityProcessor $elementEntityProcessor
Definition: CommandMap.php:75
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesSetStageBehaviour
‪applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
Definition: CommandMap.php:371
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap
Definition: CommandMap.php:33
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity
Definition: ElementEntity.php:24
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementSetStagePropertiesCallback
‪array getElementSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:648
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesSwapDependencies
‪resolveWorkspacesSwapDependencies()
Definition: CommandMap.php:263
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$parent
‪DataHandlerHook $parent
Definition: CommandMap.php:47
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_GetElementPropertiesCallback
‪const KEY_GetElementPropertiesCallback
Definition: CommandMap.php:37
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\setWorkspace
‪setWorkspace($workspace)
Definition: DependencyResolver.php:53
‪TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule
‪static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
Definition: ArrayUtility.php:614
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_ElementCreateParentReferenceCallback
‪const KEY_ElementCreateParentReferenceCallback
Definition: CommandMap.php:41
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setTceMain
‪CommandMap setTceMain(DataHandler $tceMain)
Definition: CommandMap.php:156
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\process
‪CommandMap process()
Definition: CommandMap.php:227
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\update
‪update(ElementEntity $intersectingElement, array $elements, $scope)
Definition: CommandMap.php:504
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\__construct
‪__construct(DataHandlerHook $parent, DataHandler $tceMain, array $commandMap, $workspace)
Definition: CommandMap.php:85
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver
Definition: DependencyResolver.php:23
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementEntityProcessor
‪ElementEntityProcessor getElementEntityProcessor()
Definition: CommandMap.php:213
‪TYPO3\CMS\Workspaces\Dependency\EventCallback
Definition: EventCallback.php:21
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\EVENT_Construct
‪const EVENT_Construct
Definition: ElementEntity.php:27
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_ElementCreateChildReferenceCallback
‪const KEY_ElementCreateChildReferenceCallback
Definition: CommandMap.php:40
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesDependencies
‪applyWorkspacesDependencies(DependencyResolver $dependency, $scope)
Definition: CommandMap.php:473
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspacesChangeStageMode
‪string $workspacesChangeStageMode
Definition: CommandMap.php:67
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\getElements
‪array getElements()
Definition: DependencyResolver.php:184
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$tceMain
‪DataHandler $tceMain
Definition: CommandMap.php:51
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\invokeWorkspacesSetStageItems
‪invokeWorkspacesSetStageItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:331
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesSwapBehaviour
‪applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
Definition: CommandMap.php:281
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesClear
‪const SCOPE_WorkspacesClear
Definition: CommandMap.php:36
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesSetStageDependencies
‪resolveWorkspacesSetStageDependencies()
Definition: CommandMap.php:352
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementSwapPropertiesCallback
‪array getElementSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:593
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$scopes
‪array $scopes
Definition: CommandMap.php:71
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_TransformDependentElementsToUseLiveId
‪const KEY_TransformDependentElementsToUseLiveId
Definition: CommandMap.php:43
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageIdsForVersionStateChange
‪findPageIdsForVersionStateChange($table, array $idList, $workspaceId, array &$pageIdList, array &$elementList)
Definition: DataHandlerHook.php:1498
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\processCallback
‪mixed processCallback($method, array $callbackArguments)
Definition: CommandMap.php:802
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\EVENT_CreateChildReference
‪const EVENT_CreateChildReference
Definition: ElementEntity.php:28
‪TYPO3\CMS\Workspaces\Dependency\ElementEntityProcessor\transformDependentElementsToUseLiveId
‪array transformDependentElementsToUseLiveId(array $elements)
Definition: ElementEntityProcessor.php:72
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap
‪array $commandMap
Definition: CommandMap.php:55
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesSetStage
‪const SCOPE_WorkspacesSetStage
Definition: CommandMap.php:35
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyUtility
‪DependencyResolver getDependencyUtility($scope)
Definition: CommandMap.php:684
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setWorkspace
‪setWorkspace($workspace)
Definition: CommandMap.php:167
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:130
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspace
‪int $workspace
Definition: CommandMap.php:59
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyCallback
‪EventCallback getDependencyCallback($method, array $targetArguments=[])
Definition: CommandMap.php:785
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\addWorkspacesSwapElements
‪addWorkspacesSwapElements(DependencyResolver $dependency, $table, $liveId, array $properties)
Definition: CommandMap.php:308
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementIdCallback
‪int getElementIdCallback(ElementEntity $element)
Definition: CommandMap.php:582
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\explodeSetStage
‪explodeSetStage($table, $versionIdList, array $properties)
Definition: CommandMap.php:450
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\getOuterMostParents
‪array ElementEntity[] getOuterMostParents()
Definition: DependencyResolver.php:132
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setWorkspacesChangeStageMode
‪CommandMap setWorkspacesChangeStageMode($workspacesChangeStageMode)
Definition: CommandMap.php:202
‪TYPO3\CMS\Workspaces\Dependency\ElementEntityProcessor
Definition: ElementEntityProcessor.php:26
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonSetStagePropertiesCallback
‪array getCommonSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:659
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\EVENT_CreateParentReference
‪const EVENT_CreateParentReference
Definition: ElementEntity.php:29
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setWorkspacesSwapMode
‪CommandMap setWorkspacesSwapMode($workspacesSwapMode)
Definition: CommandMap.php:189
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToBottom
‪mergeToBottom(array $commandMap)
Definition: CommandMap.php:544
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:23
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_ElementConstructCallback
‪const KEY_ElementConstructCallback
Definition: CommandMap.php:39
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesClearDependencies
‪resolveWorkspacesClearDependencies()
Definition: CommandMap.php:425
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setParent
‪CommandMap setParent(DataHandlerHook $parent)
Definition: CommandMap.php:134
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:21
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\addWorkspacesSetStageElements
‪addWorkspacesSetStageElements(DependencyResolver $dependency, $table, $versionId, array $properties)
Definition: CommandMap.php:415
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonClearPropertiesCallback
‪array getCommonClearPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:606
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_UpdateGetIdCallback
‪const KEY_UpdateGetIdCallback
Definition: CommandMap.php:42
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getParent
‪DataHandlerHook getParent()
Definition: CommandMap.php:123
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\setEventCallback
‪DependencyResolver setEventCallback($eventName, EventCallback $callback)
Definition: DependencyResolver.php:75
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findRealPageIds
‪findRealPageIds(array &$idList)
Definition: DataHandlerHook.php:1553
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageElementsForVersionSwap
‪array findPageElementsForVersionSwap($table, $id, $offlineId)
Definition: DataHandlerHook.php:1371
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\addElement
‪ElementEntity addElement($table, $id, array $data=[])
Definition: DependencyResolver.php:119
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspacesSwapMode
‪string $workspacesSwapMode
Definition: CommandMap.php:63
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getWorkspace
‪int getWorkspace()
Definition: CommandMap.php:177
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\setOuterMostParentsRequireReferences
‪DependencyResolver setOuterMostParentsRequireReferences($outerMostParentsRequireReferences)
Definition: DependencyResolver.php:105
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\getNestedElements
‪array getNestedElements(ElementEntity $outerMostParent)
Definition: DependencyResolver.php:169
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementLiveIdCallback
‪int getElementLiveIdCallback(ElementEntity $element)
Definition: CommandMap.php:571
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageElementsForVersionStageChange
‪findPageElementsForVersionStageChange(array $pageIdList, $workspaceId, array &$elementList)
Definition: DataHandlerHook.php:1440