‪TYPO3CMS  9.5
Backend.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 
23 
30 {
34  protected ‪$session;
35 
39  protected ‪$persistenceManager;
40 
44  protected ‪$aggregateRootObjects;
45 
50 
54  protected ‪$changedEntities;
55 
60 
64  protected ‪$reflectionService;
65 
69  protected ‪$qomFactory;
70 
74  protected ‪$storageBackend;
75 
79  protected ‪$dataMapFactory;
80 
86  protected ‪$referenceIndex;
87 
91  protected ‪$configurationManager;
92 
97 
101  public function ‪injectSession(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\‪Session ‪$session)
102  {
103  $this->session = ‪$session;
104  }
105 
109  public function ‪injectReflectionService(\‪TYPO3\CMS\‪Extbase\Reflection\ReflectionService ‪$reflectionService)
110  {
111  $this->reflectionService = ‪$reflectionService;
112  }
113 
117  public function ‪injectQomFactory(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Qom\QueryObjectModelFactory ‪$qomFactory)
118  {
119  $this->qomFactory = ‪$qomFactory;
120  }
121 
125  public function ‪injectStorageBackend(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Storage\‪BackendInterface ‪$storageBackend)
126  {
127  $this->storageBackend = ‪$storageBackend;
128  }
129 
133  public function ‪injectDataMapFactory(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\DataMapFactory ‪$dataMapFactory)
134  {
135  $this->dataMapFactory = ‪$dataMapFactory;
136  }
137 
141  public function ‪injectSignalSlotDispatcher(\‪TYPO3\CMS\‪Extbase\SignalSlot\Dispatcher ‪$signalSlotDispatcher)
142  {
143  $this->signalSlotDispatcher = ‪$signalSlotDispatcher;
144  }
145 
152  {
153  $this->configurationManager = ‪$configurationManager;
154  $this->referenceIndex = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\‪TYPO3\CMS\Core\Database\ReferenceIndex::class);
155  $this->referenceIndex->enableRuntimeCache();
156  $this->aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
157  $this->deletedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
158  $this->changedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
159  }
160 
165  {
166  $this->persistenceManager = ‪$persistenceManager;
167  }
168 
174  public function ‪getSession()
175  {
176  return ‪$this->session;
177  }
178 
184  public function ‪getQomFactory()
185  {
186  return ‪$this->qomFactory;
187  }
188 
194  public function ‪getReflectionService()
195  {
197  }
198 
205  public function ‪getObjectCountByQuery(\‪TYPO3\CMS\‪Extbase\Persistence\QueryInterface $query)
206  {
207  return $this->storageBackend->getObjectCountByQuery($query);
208  }
209 
216  public function ‪getObjectDataByQuery(\‪TYPO3\CMS\‪Extbase\Persistence\QueryInterface $query)
217  {
218  $query = $this->‪emitBeforeGettingObjectDataSignal($query);
219  $result = $this->storageBackend->getObjectDataByQuery($query);
220  $result = $this->‪emitAfterGettingObjectDataSignal($query, $result);
221  return $result;
222  }
223 
230  protected function ‪emitBeforeGettingObjectDataSignal(\‪TYPO3\CMS\‪Extbase\Persistence\‪QueryInterface $query)
231  {
232  $signalArguments = $this->signalSlotDispatcher->dispatch(__CLASS__, 'beforeGettingObjectData', [$query]);
233  return $signalArguments[0];
234  }
235 
243  protected function ‪emitAfterGettingObjectDataSignal(\‪TYPO3\CMS\‪Extbase\Persistence\‪QueryInterface $query, array $result)
244  {
245  $signalArguments = $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterGettingObjectData', [$query, $result]);
246  return $signalArguments[1];
247  }
248 
256  public function ‪getIdentifierByObject($object)
257  {
258  if ($object instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\‪LazyLoadingProxy) {
259  $object = $object->_loadRealInstance();
260  if (!is_object($object)) {
261  return null;
262  }
263  }
264  return $this->session->getIdentifierByObject($object);
265  }
266 
275  public function ‪getObjectByIdentifier($identifier, $className)
276  {
277  if ($this->session->hasIdentifier($identifier, $className)) {
278  return $this->session->getObjectByIdentifier($identifier, $className);
279  }
280  $query = $this->persistenceManager->createQueryForType($className);
281  $query->getQuerySettings()->setRespectStoragePage(false);
282  $query->getQuerySettings()->setRespectSysLanguage(false);
283  $query->getQuerySettings()->setLanguageOverlayMode(true);
284  return $query->matching($query->equals('uid', $identifier))->execute()->getFirst();
285  }
286 
293  public function ‪isNewObject($object)
294  {
295  return $this->‪getIdentifierByObject($object) === null;
296  }
297 
303  public function ‪setAggregateRootObjects(\‪TYPO3\CMS\‪Extbase\Persistence\‪ObjectStorage $objects)
304  {
305  $this->aggregateRootObjects = $objects;
306  }
307 
313  public function ‪setChangedEntities(\‪TYPO3\CMS\‪Extbase\Persistence\ObjectStorage $entities)
314  {
315  $this->changedEntities = $entities;
316  }
317 
323  public function ‪setDeletedEntities(\‪TYPO3\CMS\‪Extbase\Persistence\ObjectStorage $entities)
324  {
325  $this->deletedEntities = $entities;
326  }
327 
331  public function ‪commit()
332  {
333  $this->‪persistObjects();
334  $this->‪processDeletedObjects();
335  }
336 
340  protected function ‪persistObjects()
341  {
342  $this->visitedDuringPersistence = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
343  foreach ($this->aggregateRootObjects as $object) {
345  if ($object->_isNew()) {
346  $this->‪insertObject($object);
347  }
348  $this->‪persistObject($object);
349  }
350  foreach ($this->changedEntities as $object) {
351  $this->‪persistObject($object);
352  }
353  }
354 
360  protected function ‪persistObject(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object)
361  {
362  if (isset($this->visitedDuringPersistence[$object])) {
363  return;
364  }
365  $row = [];
366  $queue = [];
367  $dataMap = $this->dataMapFactory->buildDataMap(get_class($object));
368  $properties = $object->_getProperties();
369  foreach ($properties as $propertyName => $propertyValue) {
370  if (!$dataMap->isPersistableProperty($propertyName) || $this->propertyValueIsLazyLoaded($propertyValue)) {
371  continue;
372  }
373  $columnMap = $dataMap->getColumnMap($propertyName);
374  if ($propertyValue instanceof \‪TYPO3\CMS\‪Extbase\Persistence\ObjectStorage) {
375  $cleanProperty = $object->_getCleanProperty($propertyName);
376  // objectstorage needs to be persisted if the object is new, the objectstorge is dirty, meaning it has
377  // been changed after initial build, or an empty objectstorge is present and the cleanstate objectstorage
378  // has childelements, meaning all elements should been removed from the objectstorage
379  if ($object->_isNew() || $propertyValue->_isDirty() || ($propertyValue->count() === 0 && $cleanProperty && $cleanProperty->count() > 0)) {
380  $this->‪persistObjectStorage($propertyValue, $object, $propertyName, $row);
381  $propertyValue->_memorizeCleanState();
382  }
383  foreach ($propertyValue as $containedObject) {
384  if ($containedObject instanceof \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface) {
385  $queue[] = $containedObject;
386  }
387  }
388  } elseif ($propertyValue instanceof \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface
389  && $object instanceof ObjectMonitoringInterface) {
390  if ($object->_isDirty($propertyName)) {
391  if ($propertyValue->_isNew()) {
392  $this->‪insertObject($propertyValue, $object, $propertyName);
393  }
394  $row[$columnMap->getColumnName()] = $this->‪getPlainValue($propertyValue);
395  }
396  $queue[] = $propertyValue;
397  } elseif ($object->_isNew() || $object->_isDirty($propertyName)) {
398  $row[$columnMap->getColumnName()] = $this->‪getPlainValue($propertyValue, $columnMap);
399  }
400  }
401  if (!empty($row)) {
402  $this->‪updateObject($object, $row);
403  $object->_memorizeCleanState();
404  }
405  $this->visitedDuringPersistence[$object] = $object->getUid();
406  foreach ($queue as $queuedObject) {
407  $this->‪persistObject($queuedObject);
408  }
409  $this->‪emitAfterPersistObjectSignal($object);
410  }
411 
418  protected function ‪propertyValueIsLazyLoaded($propertyValue)
419  {
420  if ($propertyValue instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\LazyLoadingProxy) {
421  return true;
422  }
423  if ($propertyValue instanceof \‪TYPO3\CMS\‪Extbase\Persistence\Generic\LazyObjectStorage) {
424  if ($propertyValue->isInitialized() === false) {
425  return true;
426  }
427  }
428  return false;
429  }
430 
442  protected function ‪persistObjectStorage(\‪TYPO3\CMS\‪Extbase\Persistence\‪ObjectStorage $objectStorage, \‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $parentObject, $propertyName, array &$row)
443  {
444  $className = get_class($parentObject);
445  $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
446  $dataMapper = $objectManager->get(DataMapper::class);
447  $columnMap = $this->dataMapFactory->buildDataMap($className)->getColumnMap($propertyName);
448  $propertyMetaData = $this->reflectionService->getClassSchema($className)->getProperty($propertyName);
449  foreach ($this->‪getRemovedChildObjects($parentObject, $propertyName) as $removedObject) {
450  $this->‪detachObjectFromParentObject($removedObject, $parentObject, $propertyName);
451  if ($columnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY && $propertyMetaData['annotations']['cascade'] === 'remove') {
452  $this->‪removeEntity($removedObject);
453  }
454  }
455 
456  $currentUids = [];
457  $sortingPosition = 1;
458  $updateSortingOfFollowing = false;
459 
460  foreach ($objectStorage as $object) {
462  if (empty($currentUids)) {
463  $sortingPosition = 1;
464  } else {
465  $sortingPosition++;
466  }
467  $cleanProperty = $parentObject->_getCleanProperty($propertyName);
468  if ($object->_isNew()) {
469  $this->‪insertObject($object);
470  $this->‪attachObjectToParentObject($object, $parentObject, $propertyName, $sortingPosition);
471  // if a new object is inserted, all objects after this need to have their sorting updated
472  $updateSortingOfFollowing = true;
473  } elseif ($cleanProperty === null || $cleanProperty->getPosition($object) === null) {
474  // if parent object is new then it doesn't have cleanProperty yet; before attaching object it's clean position is null
475  $this->‪attachObjectToParentObject($object, $parentObject, $propertyName, $sortingPosition);
476  // if a relation is dirty (speaking the same object is removed and added again at a different position), all objects after this needs to be updated the sorting
477  $updateSortingOfFollowing = true;
478  } elseif ($objectStorage->isRelationDirty($object) || $cleanProperty->getPosition($object) !== $objectStorage->getPosition($object)) {
479  $this->‪updateRelationOfObjectToParentObject($object, $parentObject, $propertyName, $sortingPosition);
480  $updateSortingOfFollowing = true;
481  } elseif ($updateSortingOfFollowing) {
482  if ($sortingPosition > $objectStorage->getPosition($object)) {
483  $this->‪updateRelationOfObjectToParentObject($object, $parentObject, $propertyName, $sortingPosition);
484  } else {
485  $sortingPosition = $objectStorage->getPosition($object);
486  }
487  }
488  $currentUids[] = $object->getUid();
489  }
490 
491  if ($columnMap->getParentKeyFieldName() === null) {
492  $row[$columnMap->getColumnName()] = implode(',', $currentUids);
493  } else {
494  $row[$columnMap->getColumnName()] = $dataMapper->countRelated($parentObject, $propertyName);
495  }
496  }
497 
506  protected function ‪getRemovedChildObjects(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, $propertyName)
507  {
508  $removedObjects = [];
509  $cleanPropertyValue = $object->_getCleanProperty($propertyName);
510  if (is_array($cleanPropertyValue) || $cleanPropertyValue instanceof \Iterator) {
511  $propertyValue = $object->_getProperty($propertyName);
512  foreach ($cleanPropertyValue as $containedObject) {
513  if (!$propertyValue->contains($containedObject)) {
514  $removedObjects[] = $containedObject;
515  }
516  }
517  }
518  return $removedObjects;
519  }
520 
529  protected function ‪attachObjectToParentObject(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName, $sortingPosition = 0)
530  {
531  $parentDataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
532 
533  $parentColumnMap = $parentDataMap->getColumnMap($parentPropertyName);
534  if ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY) {
535  $this->‪attachObjectToParentObjectRelationHasMany($object, $parentObject, $parentPropertyName, $sortingPosition);
536  } elseif ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
537  $this->‪insertRelationInRelationtable($object, $parentObject, $parentPropertyName, $sortingPosition);
538  }
539  }
540 
549  protected function ‪updateRelationOfObjectToParentObject(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\AbstractEntity $parentObject, $parentPropertyName, $sortingPosition = 0)
550  {
551  $parentDataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
552  $parentColumnMap = $parentDataMap->getColumnMap($parentPropertyName);
553  if ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY) {
554  $this->‪attachObjectToParentObjectRelationHasMany($object, $parentObject, $parentPropertyName, $sortingPosition);
555  } elseif ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
556  $this->‪updateRelationInRelationTable($object, $parentObject, $parentPropertyName, $sortingPosition);
557  }
558  }
559 
569  protected function ‪attachObjectToParentObjectRelationHasMany(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\AbstractEntity $parentObject, $parentPropertyName, $sortingPosition = 0)
570  {
571  $parentDataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
572  $parentColumnMap = $parentDataMap->getColumnMap($parentPropertyName);
573  if ($parentColumnMap->getTypeOfRelation() !== \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY) {
574  throw new \TYPO3\CMS\Extbase\Persistence\Exception\IllegalRelationTypeException(
575  'Parent column relation type is ' . $parentColumnMap->getTypeOfRelation() .
576  ' but should be ' . \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY,
577  1345368105
578  );
579  }
580  $row = [];
581  $parentKeyFieldName = $parentColumnMap->getParentKeyFieldName();
582  if ($parentKeyFieldName !== null) {
583  $row[$parentKeyFieldName] = $parentObject->_getProperty('_localizedUid') ?: $parentObject->getUid();
584  $parentTableFieldName = $parentColumnMap->getParentTableFieldName();
585  if ($parentTableFieldName !== null) {
586  $row[$parentTableFieldName] = $parentDataMap->getTableName();
587  }
588  $relationTableMatchFields = $parentColumnMap->getRelationTableMatchFields();
589  if (is_array($relationTableMatchFields)) {
590  $row = array_merge($relationTableMatchFields, $row);
591  }
592  }
593  $childSortByFieldName = $parentColumnMap->getChildSortByFieldName();
594  if (!empty($childSortByFieldName)) {
595  $row[$childSortByFieldName] = $sortingPosition;
596  }
597  if (!empty($row)) {
598  $this->‪updateObject($object, $row);
599  }
600  }
601 
609  protected function ‪detachObjectFromParentObject(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
610  {
611  $parentDataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
612  $parentColumnMap = $parentDataMap->getColumnMap($parentPropertyName);
613  if ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY) {
614  $row = [];
615  $parentKeyFieldName = $parentColumnMap->getParentKeyFieldName();
616  if ($parentKeyFieldName !== null) {
617  $row[$parentKeyFieldName] = 0;
618  $parentTableFieldName = $parentColumnMap->getParentTableFieldName();
619  if ($parentTableFieldName !== null) {
620  $row[$parentTableFieldName] = '';
621  }
622  $relationTableMatchFields = $parentColumnMap->getRelationTableMatchFields();
623  if (is_array($relationTableMatchFields) && !empty($relationTableMatchFields)) {
624  $row = array_merge(array_fill_keys(array_keys($relationTableMatchFields), ''), $row);
625  }
626  }
627  $childSortByFieldName = $parentColumnMap->getChildSortByFieldName();
628  if (!empty($childSortByFieldName)) {
629  $row[$childSortByFieldName] = 0;
630  }
631  if (!empty($row)) {
632  $this->‪updateObject($object, $row);
633  }
634  } elseif ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
635  $this->‪deleteRelationFromRelationtable($object, $parentObject, $parentPropertyName);
636  }
637  }
638 
646  protected function ‪insertObject(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $parentObject = null, $parentPropertyName = '')
647  {
648  if ($object instanceof \‪TYPO3\CMS\‪Extbase\DomainObject\AbstractValueObject) {
649  $result = $this->‪getUidOfAlreadyPersistedValueObject($object);
650  if ($result !== false) {
651  $object->_setProperty('uid', (int)$result);
652  return;
653  }
654  }
655  $dataMap = $this->dataMapFactory->buildDataMap(get_class($object));
656  $row = [];
657  $properties = $object->_getProperties();
658  foreach ($properties as $propertyName => $propertyValue) {
659  if (!$dataMap->isPersistableProperty($propertyName) || $this->propertyValueIsLazyLoaded($propertyValue)) {
660  continue;
661  }
662  $columnMap = $dataMap->getColumnMap($propertyName);
663  if ($columnMap->getTypeOfRelation() === ‪ColumnMap::RELATION_HAS_ONE) {
664  $row[$columnMap->getColumnName()] = 0;
665  } elseif ($columnMap->getTypeOfRelation() !== ‪ColumnMap::RELATION_NONE) {
666  if ($columnMap->getParentKeyFieldName() === null) {
667  // CSV type relation
668  $row[$columnMap->getColumnName()] = '';
669  } else {
670  // MM type relation
671  $row[$columnMap->getColumnName()] = 0;
672  }
673  } elseif ($propertyValue !== null) {
674  $row[$columnMap->getColumnName()] = $this->‪getPlainValue($propertyValue, $columnMap);
675  }
676  }
677  $this->‪addCommonFieldsToRow($object, $row);
678  if ($dataMap->getLanguageIdColumnName() !== null && $object->_getProperty('_languageUid') === null) {
679  $row[$dataMap->getLanguageIdColumnName()] = 0;
680  $object->_setProperty('_languageUid', 0);
681  }
682  if ($dataMap->getTranslationOriginColumnName() !== null) {
683  $row[$dataMap->getTranslationOriginColumnName()] = 0;
684  }
685  if ($dataMap->getTranslationOriginDiffSourceName() !== null) {
686  $row[$dataMap->getTranslationOriginDiffSourceName()] = '';
687  }
688  if ($parentObject !== null && $parentPropertyName) {
689  $parentColumnDataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject))->getColumnMap($parentPropertyName);
690  $relationTableMatchFields = $parentColumnDataMap->getRelationTableMatchFields();
691  if (is_array($relationTableMatchFields)) {
692  $row = array_merge($relationTableMatchFields, $row);
693  }
694  if ($parentColumnDataMap->getParentKeyFieldName() !== null) {
695  $row[$parentColumnDataMap->getParentKeyFieldName()] = (int)$parentObject->getUid();
696  }
697  }
698  $uid = $this->storageBackend->addRow($dataMap->getTableName(), $row);
699  $object->_setProperty('uid', (int)$uid);
700  $object->setPid((int)$row['pid']);
701  if ((int)$uid >= 1) {
702  $this->‪emitAfterInsertObjectSignal($object);
703  }
704  $frameworkConfiguration = $this->configurationManager->getConfiguration(\‪TYPO3\CMS\‪Extbase\Configuration\‪ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
705  if ($frameworkConfiguration['persistence']['updateReferenceIndex'] === '1') {
706  $this->referenceIndex->updateRefIndexTable($dataMap->getTableName(), $uid);
707  }
708  $this->session->registerObject($object, $uid);
709  if ((int)$uid >= 1) {
710  $this->‪emitEndInsertObjectSignal($object);
711  }
712  }
713 
719  protected function ‪emitAfterInsertObjectSignal(DomainObjectInterface $object)
720  {
721  $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterInsertObject', [$object]);
722  }
723 
730  protected function ‪emitEndInsertObjectSignal(DomainObjectInterface $object)
731  {
732  $this->signalSlotDispatcher->dispatch(__CLASS__, 'endInsertObject', [$object]);
733  }
734 
741  protected function ‪getUidOfAlreadyPersistedValueObject(\‪TYPO3\CMS\‪Extbase\DomainObject\AbstractValueObject $object)
742  {
743  return $this->storageBackend->getUidOfAlreadyPersistedValueObject($object);
744  }
745 
755  protected function ‪insertRelationInRelationtable(\‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $parentObject, $propertyName, $sortingPosition = null)
756  {
757  $dataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
758  $columnMap = $dataMap->getColumnMap($propertyName);
759  $parentUid = $parentObject->getUid();
760  if ($parentObject->_getProperty('_localizedUid') !== null) {
761  $parentUid = $parentObject->_getProperty('_localizedUid');
762  }
763  $row = [
764  $columnMap->getParentKeyFieldName() => (int)$parentUid,
765  $columnMap->getChildKeyFieldName() => (int)$object->getUid(),
766  $columnMap->getChildSortByFieldName() => $sortingPosition !== null ? (int)$sortingPosition : 0
767  ];
768  $relationTableName = $columnMap->getRelationTableName();
769  if ($columnMap->getRelationTablePageIdColumnName() !== null) {
770  $row[$columnMap->getRelationTablePageIdColumnName()] = $this->‪determineStoragePageIdForNewRecord();
771  }
772  $relationTableMatchFields = $columnMap->getRelationTableMatchFields();
773  if (is_array($relationTableMatchFields)) {
774  $row = array_merge($relationTableMatchFields, $row);
775  }
776  $relationTableInsertFields = $columnMap->getRelationTableInsertFields();
777  if (is_array($relationTableInsertFields)) {
778  $row = array_merge($relationTableInsertFields, $row);
779  }
780  $res = $this->storageBackend->addRow($relationTableName, $row, true);
781  return $res;
782  }
783 
793  protected function ‪updateRelationInRelationTable(\‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $object, \‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $parentObject, $propertyName, $sortingPosition = 0)
794  {
795  $dataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
796  $columnMap = $dataMap->getColumnMap($propertyName);
797  $row = [
798  $columnMap->getParentKeyFieldName() => (int)$parentObject->getUid(),
799  $columnMap->getChildKeyFieldName() => (int)$object->getUid(),
800  $columnMap->getChildSortByFieldName() => (int)$sortingPosition
801  ];
802  $relationTableName = $columnMap->getRelationTableName();
803  $relationTableMatchFields = $columnMap->getRelationTableMatchFields();
804  if (is_array($relationTableMatchFields)) {
805  $row = array_merge($relationTableMatchFields, $row);
806  }
807  $res = $this->storageBackend->updateRelationTableRow(
808  $relationTableName,
809  $row
810  );
811  return $res;
812  }
813 
821  protected function ‪deleteAllRelationsFromRelationtable(\‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $parentObject, $parentPropertyName)
822  {
823  $dataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
824  $columnMap = $dataMap->getColumnMap($parentPropertyName);
825  $relationTableName = $columnMap->getRelationTableName();
826  $relationMatchFields = [
827  $columnMap->getParentKeyFieldName() => (int)$parentObject->getUid()
828  ];
829  $relationTableMatchFields = $columnMap->getRelationTableMatchFields();
830  if (is_array($relationTableMatchFields)) {
831  $relationMatchFields = array_merge($relationTableMatchFields, $relationMatchFields);
832  }
833  $res = $this->storageBackend->removeRow($relationTableName, $relationMatchFields, false);
834  return $res;
835  }
836 
845  protected function ‪deleteRelationFromRelationtable(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $relatedObject, \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
846  {
847  $dataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
848  $columnMap = $dataMap->getColumnMap($parentPropertyName);
849  $relationTableName = $columnMap->getRelationTableName();
850  $relationMatchFields = [
851  $columnMap->getParentKeyFieldName() => (int)$parentObject->getUid(),
852  $columnMap->getChildKeyFieldName() => (int)$relatedObject->getUid()
853  ];
854  $relationTableMatchFields = $columnMap->getRelationTableMatchFields();
855  if (is_array($relationTableMatchFields)) {
856  $relationMatchFields = array_merge($relationTableMatchFields, $relationMatchFields);
857  }
858  $res = $this->storageBackend->removeRow($relationTableName, $relationMatchFields, false);
859  return $res;
860  }
861 
870  protected function ‪fetchMaxSortingFromParentTable(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
871  {
872  $parentDataMap = $this->dataMapFactory->buildDataMap(get_class($parentObject));
873  $parentColumnMap = $parentDataMap->getColumnMap($parentPropertyName);
874  if ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY) {
875  $tableName = $parentColumnMap->getChildTableName();
876  $sortByFieldName = $parentColumnMap->getChildSortByFieldName();
877 
878  if (empty($sortByFieldName)) {
879  return false;
880  }
881  $matchFields = [];
882  $parentKeyFieldName = $parentColumnMap->getParentKeyFieldName();
883  if ($parentKeyFieldName !== null) {
884  $matchFields[$parentKeyFieldName] = $parentObject->getUid();
885  $parentTableFieldName = $parentColumnMap->getParentTableFieldName();
886  if ($parentTableFieldName !== null) {
887  $matchFields[$parentTableFieldName] = $parentDataMap->getTableName();
888  }
889  }
890 
891  if (empty($matchFields)) {
892  return false;
893  }
894  } elseif ($parentColumnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
895  $tableName = $parentColumnMap->getRelationTableName();
896  $sortByFieldName = $parentColumnMap->getChildSortByFieldName();
897 
898  $matchFields = [
899  $parentColumnMap->getParentKeyFieldName() => (int)$parentObject->getUid()
900  ];
901 
902  $relationTableMatchFields = $parentColumnMap->getRelationTableMatchFields();
903  if (is_array($relationTableMatchFields)) {
904  $matchFields = array_merge($relationTableMatchFields, $matchFields);
905  }
906  } else {
907  throw new \TYPO3\CMS\Extbase\Persistence\Exception\IllegalRelationTypeException('Unexpected parent column relation type: ' . $parentColumnMap->getTypeOfRelation(), 1345368106);
908  }
909 
910  $result = $this->storageBackend->getMaxValueFromTable(
911  $tableName,
912  $matchFields,
913  $sortByFieldName
914  );
915  return $result;
916  }
917 
925  protected function ‪updateObject(\‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $object, array $row)
926  {
927  $dataMap = $this->dataMapFactory->buildDataMap(get_class($object));
928  $this->‪addCommonFieldsToRow($object, $row);
929  $row['uid'] = $object->getUid();
930  if ($dataMap->getLanguageIdColumnName() !== null) {
931  $row[$dataMap->getLanguageIdColumnName()] = (int)$object->_getProperty('_languageUid');
932  if ($object->_getProperty('_localizedUid') !== null) {
933  $row['uid'] = $object->_getProperty('_localizedUid');
934  }
935  }
936  $res = $this->storageBackend->updateRow($dataMap->getTableName(), $row);
937  if ($res === true) {
938  $this->‪emitAfterUpdateObjectSignal($object);
939  }
940  $frameworkConfiguration = $this->configurationManager->getConfiguration(\‪TYPO3\CMS\‪Extbase\Configuration\‪ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
941  if ($frameworkConfiguration['persistence']['updateReferenceIndex'] === '1') {
942  $this->referenceIndex->updateRefIndexTable($dataMap->getTableName(), $row['uid']);
943  }
944  return $res;
945  }
946 
952  protected function ‪emitAfterUpdateObjectSignal(DomainObjectInterface $object)
953  {
954  $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterUpdateObject', [$object]);
955  }
956 
962  protected function ‪emitAfterPersistObjectSignal(DomainObjectInterface $object)
963  {
964  $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterPersistObject', [$object]);
965  }
966 
973  protected function ‪addCommonFieldsToRow(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, array &$row)
974  {
975  $dataMap = $this->dataMapFactory->buildDataMap(get_class($object));
976  $this->‪addCommonDateFieldsToRow($object, $row);
977  if ($dataMap->getRecordTypeColumnName() !== null && $dataMap->getRecordType() !== null) {
978  $row[$dataMap->getRecordTypeColumnName()] = $dataMap->getRecordType();
979  }
980  if ($object->_isNew() && !isset($row['pid'])) {
981  $row['pid'] = $this->‪determineStoragePageIdForNewRecord($object);
982  }
983  }
984 
991  protected function ‪addCommonDateFieldsToRow(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, array &$row)
992  {
993  $dataMap = $this->dataMapFactory->buildDataMap(get_class($object));
994  if ($object->_isNew() && $dataMap->getCreationDateColumnName() !== null) {
995  $row[$dataMap->getCreationDateColumnName()] = ‪$GLOBALS['EXEC_TIME'];
996  }
997  if ($dataMap->getModificationDateColumnName() !== null) {
998  $row[$dataMap->getModificationDateColumnName()] = ‪$GLOBALS['EXEC_TIME'];
999  }
1000  }
1001 
1005  protected function ‪processDeletedObjects()
1006  {
1007  foreach ($this->deletedEntities as $entity) {
1008  if ($this->session->hasObject($entity)) {
1009  $this->‪removeEntity($entity);
1010  $this->session->unregisterReconstitutedEntity($entity);
1011  $this->session->unregisterObject($entity);
1012  }
1013  }
1014  $this->deletedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
1015  }
1016 
1023  protected function ‪removeEntity(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object, $markAsDeleted = true)
1024  {
1025  $dataMap = $this->dataMapFactory->buildDataMap(get_class($object));
1026  $tableName = $dataMap->getTableName();
1027  if ($markAsDeleted === true && $dataMap->getDeletedFlagColumnName() !== null) {
1028  $deletedColumnName = $dataMap->getDeletedFlagColumnName();
1029  $row = [
1030  'uid' => $object->getUid(),
1031  $deletedColumnName => 1
1032  ];
1033  $this->‪addCommonDateFieldsToRow($object, $row);
1034  $res = $this->storageBackend->updateRow($tableName, $row);
1035  } else {
1036  $res = $this->storageBackend->removeRow($tableName, ['uid' => $object->getUid()]);
1037  }
1038  if ($res === true) {
1039  $this->‪emitAfterRemoveObjectSignal($object);
1040  }
1041  $this->‪removeRelatedObjects($object);
1042  $frameworkConfiguration = $this->configurationManager->getConfiguration(\‪TYPO3\CMS\‪Extbase\Configuration\‪ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
1043  if ($frameworkConfiguration['persistence']['updateReferenceIndex'] === '1') {
1044  $this->referenceIndex->updateRefIndexTable($tableName, $object->getUid());
1045  }
1046  }
1047 
1053  protected function ‪emitAfterRemoveObjectSignal(DomainObjectInterface $object)
1054  {
1055  $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterRemoveObject', [$object]);
1056  }
1057 
1063  protected function ‪removeRelatedObjects(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface $object)
1064  {
1065  $className = get_class($object);
1066  $dataMap = $this->dataMapFactory->buildDataMap($className);
1067  $classSchema = $this->reflectionService->getClassSchema($className);
1068  $properties = $object->_getProperties();
1069  foreach ($properties as $propertyName => $propertyValue) {
1070  $columnMap = $dataMap->getColumnMap($propertyName);
1071  if ($columnMap === null) {
1072  continue;
1073  }
1074  $propertyMetaData = $classSchema->getProperty($propertyName);
1075  if ($propertyMetaData['annotations']['cascade'] === 'remove') {
1076  if ($columnMap->getTypeOfRelation() === \‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\‪ColumnMap::RELATION_HAS_MANY) {
1077  foreach ($propertyValue as $containedObject) {
1078  $this->‪removeEntity($containedObject);
1079  }
1080  } elseif ($propertyValue instanceof \‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface) {
1081  $this->‪removeEntity($propertyValue);
1082  }
1083  } elseif ($dataMap->getDeletedFlagColumnName() === null
1084  && $columnMap->getTypeOfRelation() === ‪ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY
1085  ) {
1086  $this->‪deleteAllRelationsFromRelationtable($object, $propertyName);
1087  }
1088  }
1089  }
1090 
1102  protected function ‪determineStoragePageIdForNewRecord(\‪TYPO3\CMS\‪Extbase\DomainObject\‪DomainObjectInterface $object = null)
1103  {
1104  $frameworkConfiguration = $this->configurationManager->getConfiguration(\‪TYPO3\CMS\‪Extbase\Configuration\‪ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
1105  if ($object !== null) {
1106  if (\‪TYPO3\CMS\‪Extbase\Reflection\ObjectAccess::isPropertyGettable($object, 'pid')) {
1108  if (isset($pid)) {
1109  return (int)$pid;
1110  }
1111  }
1112  $className = get_class($object);
1113  if (isset($frameworkConfiguration['persistence']['classes'][$className]) && !empty($frameworkConfiguration['persistence']['classes'][$className]['newRecordStoragePid'])) {
1114  return (int)$frameworkConfiguration['persistence']['classes'][$className]['newRecordStoragePid'];
1115  }
1116  }
1117  $storagePidList = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $frameworkConfiguration['persistence']['storagePid']);
1118  return (int)$storagePidList[0];
1119  }
1120 
1131  protected function ‪getPlainValue($input, ‪ColumnMap $columnMap = null)
1132  {
1133  $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
1134  $dataMapper = $objectManager->get(DataMapper::class);
1135  return $input !== null
1136  ? $dataMapper->getPlainValue($input, $columnMap)
1137  : null;
1138  }
1139 }
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend
Definition: Backend.php:30
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$deletedEntities
‪TYPO3 CMS Extbase Persistence ObjectStorage $deletedEntities
Definition: Backend.php:45
‪TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
Definition: PersistenceManagerInterface.php:21
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$reflectionService
‪TYPO3 CMS Extbase Reflection ReflectionService $reflectionService
Definition: Backend.php:57
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitAfterInsertObjectSignal
‪emitAfterInsertObjectSignal(DomainObjectInterface $object)
Definition: Backend.php:706
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$qomFactory
‪TYPO3 CMS Extbase Persistence Generic Qom QueryObjectModelFactory $qomFactory
Definition: Backend.php:61
‪TYPO3\CMS\Extbase\Persistence\QueryInterface
Definition: QueryInterface.php:26
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\insertObject
‪insertObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject=null, $parentPropertyName='')
Definition: Backend.php:633
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getQomFactory
‪TYPO3 CMS Extbase Persistence Generic Qom QueryObjectModelFactory getQomFactory()
Definition: Backend.php:171
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getObjectDataByQuery
‪array getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query)
Definition: Backend.php:203
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$storageBackend
‪TYPO3 CMS Extbase Persistence Generic Storage BackendInterface $storageBackend
Definition: Backend.php:65
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\persistObjectStorage
‪persistObjectStorage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objectStorage, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $propertyName, array &$row)
Definition: Backend.php:429
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\attachObjectToParentObjectRelationHasMany
‪attachObjectToParentObjectRelationHasMany(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $parentObject, $parentPropertyName, $sortingPosition=0)
Definition: Backend.php:556
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$session
‪TYPO3 CMS Extbase Persistence Generic Session $session
Definition: Backend.php:33
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\addCommonFieldsToRow
‪addCommonFieldsToRow(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, array &$row)
Definition: Backend.php:960
‪TYPO3
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\detachObjectFromParentObject
‪detachObjectFromParentObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
Definition: Backend.php:596
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\addCommonDateFieldsToRow
‪addCommonDateFieldsToRow(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, array &$row)
Definition: Backend.php:978
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap
Definition: ColumnMap.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\deleteAllRelationsFromRelationtable
‪bool deleteAllRelationsFromRelationtable(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
Definition: Backend.php:808
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getReflectionService
‪TYPO3 CMS Extbase Reflection ReflectionService getReflectionService()
Definition: Backend.php:181
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitBeforeGettingObjectDataSignal
‪TYPO3 CMS Extbase Persistence QueryInterface emitBeforeGettingObjectDataSignal(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query)
Definition: Backend.php:217
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\insertRelationInRelationtable
‪int insertRelationInRelationtable(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $propertyName, $sortingPosition=null)
Definition: Backend.php:742
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\updateObject
‪bool updateObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, array $row)
Definition: Backend.php:912
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_AND_BELONGS_TO_MANY
‪const RELATION_HAS_AND_BELONGS_TO_MANY
Definition: ColumnMap.php:30
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitAfterPersistObjectSignal
‪emitAfterPersistObjectSignal(DomainObjectInterface $object)
Definition: Backend.php:949
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\updateRelationOfObjectToParentObject
‪updateRelationOfObjectToParentObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $parentObject, $parentPropertyName, $sortingPosition=0)
Definition: Backend.php:536
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\injectDataMapFactory
‪injectDataMapFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory $dataMapFactory)
Definition: Backend.php:120
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\setAggregateRootObjects
‪setAggregateRootObjects(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects)
Definition: Backend.php:290
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitEndInsertObjectSignal
‪emitEndInsertObjectSignal(DomainObjectInterface $object)
Definition: Backend.php:717
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\processDeletedObjects
‪processDeletedObjects()
Definition: Backend.php:992
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
Definition: DataMapper.php:32
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\commit
‪commit()
Definition: Backend.php:318
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$configurationManager
‪TYPO3 CMS Extbase Configuration ConfigurationManagerInterface $configurationManager
Definition: Backend.php:79
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitAfterRemoveObjectSignal
‪emitAfterRemoveObjectSignal(DomainObjectInterface $object)
Definition: Backend.php:1040
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_MANY
‪const RELATION_HAS_MANY
Definition: ColumnMap.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\persistObject
‪persistObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object)
Definition: Backend.php:347
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\injectReflectionService
‪injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
Definition: Backend.php:96
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_ONE
‪const RELATION_HAS_ONE
Definition: ColumnMap.php:27
‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
Definition: ObjectStorage.php:26
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK
‪const CONFIGURATION_TYPE_FRAMEWORK
Definition: ConfigurationManagerInterface.php:23
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\attachObjectToParentObject
‪attachObjectToParentObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName, $sortingPosition=0)
Definition: Backend.php:516
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\determineStoragePageIdForNewRecord
‪int determineStoragePageIdForNewRecord(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object=null)
Definition: Backend.php:1089
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\injectSession
‪injectSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $session)
Definition: Backend.php:88
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getPlainValue
‪int string null getPlainValue($input, ColumnMap $columnMap=null)
Definition: Backend.php:1118
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\injectSignalSlotDispatcher
‪injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
Definition: Backend.php:128
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$aggregateRootObjects
‪TYPO3 CMS Extbase Persistence ObjectStorage $aggregateRootObjects
Definition: Backend.php:41
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\propertyValueIsLazyLoaded
‪bool propertyValueIsLazyLoaded($propertyValue)
Definition: Backend.php:405
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\deleteRelationFromRelationtable
‪bool deleteRelationFromRelationtable(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $relatedObject, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
Definition: Backend.php:832
‪TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
Definition: BackendInterface.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$visitedDuringPersistence
‪TYPO3 CMS Extbase Persistence ObjectStorage $visitedDuringPersistence
Definition: Backend.php:53
‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface
Definition: DomainObjectInterface.php:26
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$referenceIndex
‪TYPO3 CMS Core Database ReferenceIndex $referenceIndex
Definition: Backend.php:75
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_NONE
‪const RELATION_NONE
Definition: ColumnMap.php:26
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\removeRelatedObjects
‪removeRelatedObjects(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object)
Definition: Backend.php:1050
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitAfterUpdateObjectSignal
‪emitAfterUpdateObjectSignal(DomainObjectInterface $object)
Definition: Backend.php:939
‪TYPO3\CMS\Extbase\Persistence\Generic\Session
Definition: Session.php:24
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\__construct
‪__construct(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
Definition: Backend.php:138
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getRemovedChildObjects
‪array getRemovedChildObjects(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, $propertyName)
Definition: Backend.php:493
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\removeEntity
‪removeEntity(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, $markAsDeleted=true)
Definition: Backend.php:1010
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\updateRelationInRelationTable
‪bool updateRelationInRelationTable(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $propertyName, $sortingPosition=0)
Definition: Backend.php:780
‪TYPO3\CMS\Extbase\Persistence\Generic
Definition: Backend.php:2
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\setDeletedEntities
‪setDeletedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities)
Definition: Backend.php:310
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$dataMapFactory
‪TYPO3 CMS Extbase Persistence Generic Mapper DataMapFactory $dataMapFactory
Definition: Backend.php:69
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\injectStorageBackend
‪injectStorageBackend(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface $storageBackend)
Definition: Backend.php:112
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getProperty
‪static mixed getProperty($subject, $propertyName, $forceDirectAccess=false)
Definition: ObjectAccess.php:54
‪TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy
Definition: LazyLoadingProxy.php:28
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:22
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\injectQomFactory
‪injectQomFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory)
Definition: Backend.php:104
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\setPersistenceManager
‪setPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager)
Definition: Backend.php:151
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\isNewObject
‪bool isNewObject($object)
Definition: Backend.php:280
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\emitAfterGettingObjectDataSignal
‪array emitAfterGettingObjectDataSignal(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query, array $result)
Definition: Backend.php:230
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getUidOfAlreadyPersistedValueObject
‪mixed getUidOfAlreadyPersistedValueObject(\TYPO3\CMS\Extbase\DomainObject\AbstractValueObject $object)
Definition: Backend.php:728
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\fetchMaxSortingFromParentTable
‪mixed fetchMaxSortingFromParentTable(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $parentPropertyName)
Definition: Backend.php:857
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getObjectByIdentifier
‪object null getObjectByIdentifier($identifier, $className)
Definition: Backend.php:262
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getSession
‪TYPO3 CMS Extbase Persistence Generic Session getSession()
Definition: Backend.php:161
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\persistObjects
‪persistObjects()
Definition: Backend.php:327
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$changedEntities
‪TYPO3 CMS Extbase Persistence ObjectStorage $changedEntities
Definition: Backend.php:49
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage
Definition: LazyObjectStorage.php:27
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getObjectCountByQuery
‪int getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query)
Definition: Backend.php:192
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:25
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$signalSlotDispatcher
‪TYPO3 CMS Extbase SignalSlot Dispatcher $signalSlotDispatcher
Definition: Backend.php:83
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\setChangedEntities
‪setChangedEntities(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $entities)
Definition: Backend.php:300
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\$persistenceManager
‪TYPO3 CMS Extbase Persistence PersistenceManagerInterface $persistenceManager
Definition: Backend.php:37
‪TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface
Definition: ObjectMonitoringInterface.php:24
‪TYPO3\CMS\Extbase\Persistence\Generic\Backend\getIdentifierByObject
‪string null getIdentifierByObject($object)
Definition: Backend.php:243