‪TYPO3CMS  11.5
CommandMap.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use TYPO3\CMS\Backend\Utility\BackendUtility;
28 
34 {
35  public const ‪SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap';
36  public const ‪SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage';
37  public const ‪SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear';
38  public const ‪KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback';
39  public const ‪KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback';
40  public const ‪KEY_ElementConstructCallback = 'KEY_EventConstructCallback';
41  public const ‪KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback';
42  public const ‪KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback';
43  public const ‪KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback';
44  public const ‪KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId';
45 
49  protected ‪$parent;
50 
54  protected ‪$tceMain;
55 
59  protected ‪$commandMap = [];
60 
64  protected ‪$workspace;
65 
69  protected ‪$workspacesSwapMode;
70 
75 
79  protected ‪$scopes;
80 
85 
95  {
96  $this->‪setParent($parent);
97  $this->‪setTceMain($tceMain);
98  $this->set(‪$commandMap);
100  $this->‪setWorkspacesSwapMode($this->‪getTceMain()->BE_USER->getTSConfig()['options.']['workspaces.']['swapMode'] ?? '');
101  $this->‪setWorkspacesChangeStageMode($this->‪getTceMain()->BE_USER->getTSConfig()['options.']['workspaces.']['changeStageMode'] ?? '');
103  }
104 
110  public function get()
111  {
112  return ‪$this->commandMap;
113  }
114 
121  public function set(array ‪$commandMap)
122  {
123  $this->commandMap = ‪$commandMap;
124  return $this;
125  }
126 
132  public function ‪getParent()
133  {
134  return ‪$this->parent;
135  }
136 
144  {
145  $this->parent = ‪$parent;
146  return $this;
147  }
148 
154  public function ‪getTceMain()
155  {
156  return ‪$this->tceMain;
157  }
158 
165  public function ‪setTceMain(‪DataHandler ‪$tceMain)
166  {
167  $this->tceMain = ‪$tceMain;
168  return $this;
169  }
170 
176  public function ‪setWorkspace(‪$workspace)
177  {
178  $this->workspace = (int)‪$workspace;
179  }
180 
186  public function ‪getWorkspace()
187  {
188  return ‪$this->workspace;
189  }
190 
199  {
200  $this->workspacesSwapMode = (string)‪$workspacesSwapMode;
201  return $this;
202  }
203 
212  {
213  $this->workspacesChangeStageMode = (string)‪$workspacesChangeStageMode;
214  return $this;
215  }
216 
222  protected function ‪getElementEntityProcessor()
223  {
224  if (!isset($this->elementEntityProcessor)) {
225  $this->elementEntityProcessor = GeneralUtility::makeInstance(ElementEntityProcessor::class);
226  $this->elementEntityProcessor->setWorkspace($this->‪getWorkspace());
227  }
229  }
230 
236  public function ‪process()
237  {
241  return $this;
242  }
243 
250  protected function ‪invokeWorkspacesSwapItems($callbackMethod, array $arguments = [])
251  {
252  // Traverses the cmd[] array and fetches the accordant actions:
253  foreach ($this->commandMap as $table => $liveIdCollection) {
254  foreach ($liveIdCollection as $liveId => $commandCollection) {
255  foreach ($commandCollection as $command => $properties) {
256  if ($command === 'version' && isset($properties['action']) && in_array($properties['action'], ['publish', 'swap'], true)) {
257  if (isset($properties['swapWith']) && ‪MathUtility::canBeInterpretedAsInteger($properties['swapWith'])) {
258  $this->$callbackMethod(...array_merge($arguments, [$table, $liveId, $properties]));
259  }
260  }
261  }
262  }
263  }
264  }
265 
272  protected function ‪resolveWorkspacesSwapDependencies()
273  {
275  $dependency = $this->‪getDependencyUtility($scope);
276  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages') {
277  $this->‪invokeWorkspacesSwapItems('applyWorkspacesSwapBehaviour');
278  }
279  $this->‪invokeWorkspacesSwapItems('addWorkspacesSwapElements', [$dependency]);
280  $this->‪applyWorkspacesDependencies($dependency, $scope);
281  }
282 
290  protected function ‪applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
291  {
292  $extendedCommandMap = [];
293  $elementList = [];
294  // Fetch accordant elements if the swapMode is 'any' or 'pages':
295  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
296  $elementList = $this->‪getParent()->‪findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
297  }
298  foreach ($elementList as $elementTable => $elementIdArray) {
299  foreach ($elementIdArray as $elementIds) {
300  $extendedCommandMap[$elementTable][$elementIds[0]]['version'] = array_merge($properties, ['swapWith' => $elementIds[1]]);
301  }
302  }
303  if (!empty($elementList)) {
304  $this->remove($table, (string)$liveId, 'version');
305  $this->‪mergeToBottom($extendedCommandMap);
306  }
307  }
308 
317  protected function ‪addWorkspacesSwapElements(‪DependencyResolver $dependency, $table, $liveId, array $properties)
318  {
319  $elementList = [];
320  // Fetch accordant elements if the swapMode is 'any' or 'pages':
321  if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
322  $elementList = $this->‪getParent()->‪findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
323  }
324  foreach ($elementList as $elementTable => $elementIdArray) {
325  foreach ($elementIdArray as $elementIds) {
326  $dependency->‪addElement($elementTable, $elementIds[1], ['liveId' => $elementIds[0], 'properties' => array_merge($properties, ['swapWith' => $elementIds[1]])]);
327  }
328  }
329  if (empty($elementList)) {
330  $dependency->‪addElement($table, $properties['swapWith'], ['liveId' => $liveId, 'properties' => $properties]);
331  }
332  }
333 
340  protected function ‪invokeWorkspacesSetStageItems($callbackMethod, array $arguments = [])
341  {
342  // Traverses the cmd[] array and fetches the accordant actions:
343  foreach ($this->commandMap as $table => $versionIdCollection) {
344  foreach ($versionIdCollection as $versionIdList => $commandCollection) {
345  foreach ($commandCollection as $command => $properties) {
346  if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
347  if (isset($properties['stageId']) && ‪MathUtility::canBeInterpretedAsInteger($properties['stageId'])) {
348  $this->$callbackMethod(...array_merge($arguments, [$table, $versionIdList, $properties]));
349  }
350  }
351  }
352  }
353  }
354  }
355 
361  protected function ‪resolveWorkspacesSetStageDependencies()
362  {
364  $dependency = $this->‪getDependencyUtility($scope);
365  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
366  $this->‪invokeWorkspacesSetStageItems('applyWorkspacesSetStageBehaviour');
367  }
368  $this->‪invokeWorkspacesSetStageItems('explodeSetStage');
369  $this->‪invokeWorkspacesSetStageItems('addWorkspacesSetStageElements', [$dependency]);
370  $this->‪applyWorkspacesDependencies($dependency, $scope);
371  }
372 
380  protected function ‪applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
381  {
382  $extendedCommandMap = [];
383  $versionIds = ‪GeneralUtility::trimExplode(',', $versionIdList, true);
384  $elementList = [$table => $versionIds];
385  if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
386  if (count($versionIds) === 1) {
387  $uid = (int)$versionIds[0];
388  $workspaceRecord = BackendUtility::getRecord($table, $uid, 't3ver_wsid');
389  $workspaceId = $workspaceRecord['t3ver_wsid'];
390  } else {
391  $workspaceId = $this->‪getWorkspace();
392  }
393  if ($table === 'pages') {
394  // Find all elements from the same ws to change stage
395  $livePageIds = $versionIds;
396  $this->‪getParent()->‪findRealPageIds($livePageIds);
397  $this->‪getParent()->‪findPageElementsForVersionStageChange($livePageIds, $workspaceId, $elementList);
398  } elseif ($this->workspacesChangeStageMode === 'any') {
399  // Find page to change stage:
400  $pageIdList = [];
401  $this->‪getParent()->‪findPageIdsForVersionStateChange($table, $versionIds, $workspaceId, $pageIdList, $elementList);
402  // Find other elements from the same ws to change stage:
403  $this->‪getParent()->‪findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
404  }
405  }
406  foreach ($elementList as $elementTable => $elementIds) {
407  foreach ($elementIds as $elementId) {
408  $extendedCommandMap[$elementTable][$elementId]['version'] = $properties;
409  }
410  }
411  foreach ($versionIds as $versionId) {
412  $this->remove($table, $versionId, 'version');
413  }
414  $this->‪mergeToBottom($extendedCommandMap);
415  }
416 
425  protected function ‪addWorkspacesSetStageElements(‪DependencyResolver $dependency, $table, $versionId, array $properties)
426  {
427  $dependency->‪addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
428  }
429 
435  protected function ‪resolveWorkspacesClearDependencies()
436  {
438  $dependency = $this->‪getDependencyUtility($scope);
439  // Traverses the cmd[] array and fetches the accordant actions:
440  foreach ($this->commandMap as $table => $versionIdCollection) {
441  foreach ($versionIdCollection as $versionId => $commandCollection) {
442  foreach ($commandCollection as $command => $properties) {
443  if ($command === 'version' && isset($properties['action']) && ($properties['action'] === 'clearWSID' || $properties['action'] === 'flush')) {
444  $dependency->‪addElement($table, $versionId, ['versionId' => $versionId, 'properties' => $properties]);
445  }
446  }
447  }
448  }
449  $this->‪applyWorkspacesDependencies($dependency, $scope);
450  }
451 
460  protected function ‪explodeSetStage($table, $versionIdList, array $properties)
461  {
462  $extractedCommandMap = [];
463  $versionIds = ‪GeneralUtility::trimExplode(',', $versionIdList, true);
464  if (count($versionIds) > 1) {
465  foreach ($versionIds as $versionId) {
466  if (isset($this->commandMap[$table][$versionId]['version'])) {
467  throw new \RuntimeException('Command map for [' . $table . '][' . $versionId . '][version] was already set.', 1289391048);
468  }
469  $extractedCommandMap[$table][$versionId]['version'] = $properties;
470  $this->remove($table, $versionId, 'version');
471  }
472  $this->‪mergeToBottom($extractedCommandMap);
473  }
474  }
475 
483  protected function ‪applyWorkspacesDependencies(‪DependencyResolver $dependency, $scope)
484  {
485  $transformDependentElementsToUseLiveId = $this->‪getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
486  $elementsToBeVersioned = $dependency->‪getElements();
487  // Use the uid of the live record instead of the workspace record:
488  if ($transformDependentElementsToUseLiveId) {
489  $elementsToBeVersioned = $this->‪getElementEntityProcessor()->‪transformDependentElementsToUseLiveId($elementsToBeVersioned);
490  }
491  $outerMostParents = $dependency->‪getOuterMostParents();
493  foreach ($outerMostParents as $outerMostParent) {
494  $dependentElements = $dependency->‪getNestedElements($outerMostParent);
495  if ($transformDependentElementsToUseLiveId) {
496  $dependentElements = $this->‪getElementEntityProcessor()->‪transformDependentElementsToUseLiveId($dependentElements);
497  }
498  // Gets the difference (intersection) between elements that were submitted by the user
499  // and the evaluation of all dependent records that should be used for this action instead:
500  $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersioned);
501  if (!empty($intersectingElements)) {
502  $this->‪update(current($intersectingElements), $dependentElements, $scope);
503  }
504  }
505  }
506 
514  protected function ‪update(‪ElementEntity $intersectingElement, array $elements, $scope)
515  {
516  $orderedCommandMap = [];
517  $commonProperties = [];
518  if ($this->‪getScopeData($scope, self::KEY_GetCommonPropertiesCallback)) {
519  $commonProperties = $this->‪processCallback($this->‪getScopeData($scope, self::KEY_GetCommonPropertiesCallback), [$intersectingElement]);
520  }
522  foreach ($elements as $element) {
523  $table = $element->getTable();
524  $id = $this->‪processCallback($this->‪getScopeData($scope, self::KEY_UpdateGetIdCallback), [$element]);
525  $this->remove($table, $id, 'version');
526  if ($element->isInvalid()) {
527  continue;
528  }
529  $orderedCommandMap[$table][$id]['version'] = $commonProperties;
530  if ($this->‪getScopeData($scope, self::KEY_GetElementPropertiesCallback)) {
531  $orderedCommandMap[$table][$id]['version'] = array_merge($commonProperties, $this->‪processCallback($this->‪getScopeData($scope, self::KEY_GetElementPropertiesCallback), [$element]));
532  }
533  }
534  // Ensure that ordered command map is on top of the command map:
535  $this->‪mergeToTop($orderedCommandMap);
536  }
537 
543  protected function ‪mergeToTop(array ‪$commandMap)
544  {
546  $this->commandMap = ‪$commandMap;
547  }
548 
554  protected function ‪mergeToBottom(array ‪$commandMap)
555  {
557  }
558 
566  protected function remove($table, $id, $command = null)
567  {
568  if (is_string($command)) {
569  unset($this->commandMap[$table][$id][$command]);
570  } else {
571  unset($this->commandMap[$table][$id]);
572  }
573  }
574 
581  protected function ‪getElementLiveIdCallback(‪ElementEntity $element)
582  {
583  return $element->‪getDataValue('liveId');
584  }
585 
592  protected function ‪getElementIdCallback(‪ElementEntity $element)
593  {
594  return $element->‪getId();
595  }
596 
603  protected function ‪getElementSwapPropertiesCallback(‪ElementEntity $element)
604  {
605  return [
606  'swapWith' => $element->‪getId(),
607  ];
608  }
609 
616  protected function ‪getCommonClearPropertiesCallback(‪ElementEntity $element)
617  {
618  $commonSwapProperties = [];
619  $elementProperties = $element->‪getDataValue('properties');
620  if (isset($elementProperties['action'])) {
621  $commonSwapProperties['action'] = $elementProperties['action'];
622  }
623  return $commonSwapProperties;
624  }
625 
632  protected function ‪getCommonSwapPropertiesCallback(‪ElementEntity $element)
633  {
634  $commonSwapProperties = [];
635  $elementProperties = $element->‪getDataValue('properties');
636  if (isset($elementProperties['action'])) {
637  $commonSwapProperties['action'] = $elementProperties['action'];
638  }
639  if (isset($elementProperties['comment'])) {
640  $commonSwapProperties['comment'] = $elementProperties['comment'];
641  }
642  if (isset($elementProperties['notificationAlternativeRecipients'])) {
643  $commonSwapProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
644  }
645 
646  return $commonSwapProperties;
647  }
648 
655  protected function ‪getElementSetStagePropertiesCallback(‪ElementEntity $element)
656  {
657  return $this->‪getCommonSetStagePropertiesCallback($element);
658  }
659 
666  protected function ‪getCommonSetStagePropertiesCallback(‪ElementEntity $element)
667  {
668  $commonSetStageProperties = [];
669  $elementProperties = $element->‪getDataValue('properties');
670  if (isset($elementProperties['stageId'])) {
671  $commonSetStageProperties['stageId'] = $elementProperties['stageId'];
672  }
673  if (isset($elementProperties['comment'])) {
674  $commonSetStageProperties['comment'] = $elementProperties['comment'];
675  }
676  if (isset($elementProperties['action'])) {
677  $commonSetStageProperties['action'] = $elementProperties['action'];
678  }
679  if (isset($elementProperties['notificationAlternativeRecipients'])) {
680  $commonSetStageProperties['notificationAlternativeRecipients'] = $elementProperties['notificationAlternativeRecipients'];
681  }
682  return $commonSetStageProperties;
683  }
684 
691  protected function ‪getDependencyUtility($scope)
692  {
693  $dependency = GeneralUtility::makeInstance(DependencyResolver::class);
694  $dependency->‪setWorkspace($this->‪getWorkspace());
695  $dependency->‪setOuterMostParentsRequireReferences(true);
696  if ($this->‪getScopeData($scope, self::KEY_ElementConstructCallback)) {
697  $dependency->‪setEventCallback(‪ElementEntity::EVENT_Construct, $this->‪getDependencyCallback($this->‪getScopeData($scope, self::KEY_ElementConstructCallback)));
698  }
699  if ($this->‪getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
700  $dependency->‪setEventCallback(‪ElementEntity::EVENT_CreateChildReference, $this->‪getDependencyCallback($this->‪getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)));
701  }
702  if ($this->‪getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
703  $dependency->‪setEventCallback(‪ElementEntity::EVENT_CreateParentReference, $this->‪getDependencyCallback($this->‪getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)));
704  }
705  return $dependency;
706  }
707 
712  protected function ‪constructScopes()
713  {
714  $this->scopes = [
715  // settings for publishing and swapping:
716  self::SCOPE_WorkspacesSwap => [
717  // callback functions used to modify the commandMap
718  // + element properties are specific for each element
719  // + common properties are the same for all elements
720  self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
721  self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
722  // callback function used, when a new element to be checked is added
723  self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
724  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
725  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
726  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
727  // callback function used to fetch the correct record uid on modifying the commandMap
728  self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
729  // setting whether to use the uid of the live record instead of the workspace record
730  self::KEY_TransformDependentElementsToUseLiveId => true,
731  ],
732  // settings for modifying the stage:
733  self::SCOPE_WorkspacesSetStage => [
734  // callback functions used to modify the commandMap
735  // + element properties are specific for each element
736  // + common properties are the same for all elements
737  self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
738  self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
739  // callback function used, when a new element to be checked is added
740  self::KEY_ElementConstructCallback => null,
741  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
742  self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
743  self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
744  // callback function used to fetch the correct record uid on modifying the commandMap
745  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
746  // setting whether to use the uid of the live record instead of the workspace record
747  self::KEY_TransformDependentElementsToUseLiveId => false,
748  ],
749  // settings for clearing and flushing:
750  self::SCOPE_WorkspacesClear => [
751  // callback functions used to modify the commandMap
752  // + element properties are specific for each element
753  // + common properties are the same for all elements
754  self::KEY_GetElementPropertiesCallback => null,
755  self::KEY_GetCommonPropertiesCallback => 'getCommonClearPropertiesCallback',
756  // callback function used, when a new element to be checked is added
757  self::KEY_ElementConstructCallback => null,
758  // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE)
759  self::KEY_ElementCreateChildReferenceCallback => 'createClearDependentElementChildReferenceCallback',
760  self::KEY_ElementCreateParentReferenceCallback => 'createClearDependentElementParentReferenceCallback',
761  // callback function used to fetch the correct record uid on modifying the commandMap
762  self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
763  // setting whether to use the uid of the live record instead of the workspace record
764  self::KEY_TransformDependentElementsToUseLiveId => false,
765  ],
766  ];
767  }
768 
777  protected function ‪getScopeData($scope, $key)
778  {
779  if (!isset($this->scopes[$scope])) {
780  throw new \RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
781  }
782  return $this->scopes[$scope][$key];
783  }
784 
792  protected function ‪getDependencyCallback($method, array $targetArguments = [])
793  {
794  return GeneralUtility::makeInstance(
795  EventCallback::class,
797  $method,
798  $targetArguments
799  );
800  }
801 
809  protected function ‪processCallback($method, array $callbackArguments)
810  {
811  return $this->$method(...$callbackArguments);
812  }
813 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:86
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\getDataValue
‪mixed getDataValue($key)
Definition: ElementEntity.php:157
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\constructScopes
‪constructScopes()
Definition: CommandMap.php:704
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:999
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonSwapPropertiesCallback
‪array getCommonSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:624
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToTop
‪mergeToTop(array $commandMap)
Definition: CommandMap.php:535
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\getId
‪int getId()
Definition: ElementEntity.php:126
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:74
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$elementEntityProcessor
‪ElementEntityProcessor null $elementEntityProcessor
Definition: CommandMap.php:76
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook
Definition: DataHandlerHook.php:50
‪TYPO3\CMS\Workspaces\DataHandler
Definition: CommandMap.php:16
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getTceMain
‪DataHandler getTceMain()
Definition: CommandMap.php:146
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_GetCommonPropertiesCallback
‪const KEY_GetCommonPropertiesCallback
Definition: CommandMap.php:39
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesSwap
‪const SCOPE_WorkspacesSwap
Definition: CommandMap.php:35
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\invokeWorkspacesSwapItems
‪invokeWorkspacesSwapItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:242
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getScopeData
‪string getScopeData($scope, $key)
Definition: CommandMap.php:769
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesSetStageBehaviour
‪applyWorkspacesSetStageBehaviour($table, $versionIdList, array $properties)
Definition: CommandMap.php:372
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap
Definition: CommandMap.php:34
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity
Definition: ElementEntity.php:26
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementSetStagePropertiesCallback
‪array getElementSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:647
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesSwapDependencies
‪resolveWorkspacesSwapDependencies()
Definition: CommandMap.php:264
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$parent
‪DataHandlerHook $parent
Definition: CommandMap.php:48
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_GetElementPropertiesCallback
‪const KEY_GetElementPropertiesCallback
Definition: CommandMap.php:38
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\setWorkspace
‪setWorkspace($workspace)
Definition: DependencyResolver.php:54
‪TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule
‪static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
Definition: ArrayUtility.php:654
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_ElementCreateParentReferenceCallback
‪const KEY_ElementCreateParentReferenceCallback
Definition: CommandMap.php:42
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setTceMain
‪CommandMap setTceMain(DataHandler $tceMain)
Definition: CommandMap.php:157
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\process
‪CommandMap process()
Definition: CommandMap.php:228
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\update
‪update(ElementEntity $intersectingElement, array $elements, $scope)
Definition: CommandMap.php:506
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\__construct
‪__construct(DataHandlerHook $parent, DataHandler $tceMain, array $commandMap, $workspace)
Definition: CommandMap.php:86
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver
Definition: DependencyResolver.php:24
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementEntityProcessor
‪ElementEntityProcessor getElementEntityProcessor()
Definition: CommandMap.php:214
‪TYPO3\CMS\Workspaces\Dependency\EventCallback
Definition: EventCallback.php:22
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\EVENT_Construct
‪const EVENT_Construct
Definition: ElementEntity.php:29
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_ElementCreateChildReferenceCallback
‪const KEY_ElementCreateChildReferenceCallback
Definition: CommandMap.php:41
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesDependencies
‪applyWorkspacesDependencies(DependencyResolver $dependency, $scope)
Definition: CommandMap.php:475
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspacesChangeStageMode
‪string $workspacesChangeStageMode
Definition: CommandMap.php:68
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\getElements
‪array getElements()
Definition: DependencyResolver.php:185
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$tceMain
‪DataHandler $tceMain
Definition: CommandMap.php:52
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\invokeWorkspacesSetStageItems
‪invokeWorkspacesSetStageItems($callbackMethod, array $arguments=[])
Definition: CommandMap.php:332
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\applyWorkspacesSwapBehaviour
‪applyWorkspacesSwapBehaviour($table, $liveId, array $properties)
Definition: CommandMap.php:282
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesClear
‪const SCOPE_WorkspacesClear
Definition: CommandMap.php:37
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesSetStageDependencies
‪resolveWorkspacesSetStageDependencies()
Definition: CommandMap.php:353
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementSwapPropertiesCallback
‪array getElementSwapPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:595
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$scopes
‪array $scopes
Definition: CommandMap.php:72
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_TransformDependentElementsToUseLiveId
‪const KEY_TransformDependentElementsToUseLiveId
Definition: CommandMap.php:44
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageIdsForVersionStateChange
‪findPageIdsForVersionStateChange($table, array $idList, $workspaceId, array &$pageIdList, array &$elementList)
Definition: DataHandlerHook.php:1367
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\processCallback
‪mixed processCallback($method, array $callbackArguments)
Definition: CommandMap.php:801
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\EVENT_CreateChildReference
‪const EVENT_CreateChildReference
Definition: ElementEntity.php:30
‪TYPO3\CMS\Workspaces\Dependency\ElementEntityProcessor\transformDependentElementsToUseLiveId
‪array transformDependentElementsToUseLiveId(array $elements)
Definition: ElementEntityProcessor.php:73
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$commandMap
‪array $commandMap
Definition: CommandMap.php:56
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\SCOPE_WorkspacesSetStage
‪const SCOPE_WorkspacesSetStage
Definition: CommandMap.php:36
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyUtility
‪DependencyResolver getDependencyUtility($scope)
Definition: CommandMap.php:683
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setWorkspace
‪setWorkspace($workspace)
Definition: CommandMap.php:168
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspace
‪int $workspace
Definition: CommandMap.php:60
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getDependencyCallback
‪EventCallback getDependencyCallback($method, array $targetArguments=[])
Definition: CommandMap.php:784
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\addWorkspacesSwapElements
‪addWorkspacesSwapElements(DependencyResolver $dependency, $table, $liveId, array $properties)
Definition: CommandMap.php:309
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementIdCallback
‪int getElementIdCallback(ElementEntity $element)
Definition: CommandMap.php:584
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\explodeSetStage
‪explodeSetStage($table, $versionIdList, array $properties)
Definition: CommandMap.php:452
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\getOuterMostParents
‪array ElementEntity[] getOuterMostParents()
Definition: DependencyResolver.php:133
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setWorkspacesChangeStageMode
‪CommandMap setWorkspacesChangeStageMode($workspacesChangeStageMode)
Definition: CommandMap.php:203
‪TYPO3\CMS\Workspaces\Dependency\ElementEntityProcessor
Definition: ElementEntityProcessor.php:27
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonSetStagePropertiesCallback
‪array getCommonSetStagePropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:658
‪TYPO3\CMS\Workspaces\Dependency\ElementEntity\EVENT_CreateParentReference
‪const EVENT_CreateParentReference
Definition: ElementEntity.php:31
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setWorkspacesSwapMode
‪CommandMap setWorkspacesSwapMode($workspacesSwapMode)
Definition: CommandMap.php:190
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\mergeToBottom
‪mergeToBottom(array $commandMap)
Definition: CommandMap.php:546
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:24
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_ElementConstructCallback
‪const KEY_ElementConstructCallback
Definition: CommandMap.php:40
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\resolveWorkspacesClearDependencies
‪resolveWorkspacesClearDependencies()
Definition: CommandMap.php:427
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\setParent
‪CommandMap setParent(DataHandlerHook $parent)
Definition: CommandMap.php:135
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:22
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\addWorkspacesSetStageElements
‪addWorkspacesSetStageElements(DependencyResolver $dependency, $table, $versionId, array $properties)
Definition: CommandMap.php:417
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getCommonClearPropertiesCallback
‪array getCommonClearPropertiesCallback(ElementEntity $element)
Definition: CommandMap.php:608
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\KEY_UpdateGetIdCallback
‪const KEY_UpdateGetIdCallback
Definition: CommandMap.php:43
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getParent
‪DataHandlerHook getParent()
Definition: CommandMap.php:124
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\setEventCallback
‪DependencyResolver setEventCallback($eventName, EventCallback $callback)
Definition: DependencyResolver.php:76
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findRealPageIds
‪findRealPageIds(array &$idList)
Definition: DataHandlerHook.php:1422
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageElementsForVersionSwap
‪array findPageElementsForVersionSwap($table, $id, $offlineId)
Definition: DataHandlerHook.php:1240
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\addElement
‪ElementEntity addElement($table, $id, array $data=[])
Definition: DependencyResolver.php:120
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\$workspacesSwapMode
‪string $workspacesSwapMode
Definition: CommandMap.php:64
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getWorkspace
‪int getWorkspace()
Definition: CommandMap.php:178
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\setOuterMostParentsRequireReferences
‪DependencyResolver setOuterMostParentsRequireReferences($outerMostParentsRequireReferences)
Definition: DependencyResolver.php:106
‪TYPO3\CMS\Workspaces\Dependency\DependencyResolver\getNestedElements
‪array getNestedElements(ElementEntity $outerMostParent)
Definition: DependencyResolver.php:170
‪TYPO3\CMS\Workspaces\DataHandler\CommandMap\getElementLiveIdCallback
‪int getElementLiveIdCallback(ElementEntity $element)
Definition: CommandMap.php:573
‪TYPO3\CMS\Workspaces\Hook\DataHandlerHook\findPageElementsForVersionStageChange
‪findPageElementsForVersionStageChange(array $pageIdList, $workspaceId, array &$elementList)
Definition: DataHandlerHook.php:1309