‪TYPO3CMS  9.5
DataMapper.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 
26 
32 {
36  protected ‪$reflectionService;
37 
41  protected ‪$qomFactory;
42 
46  protected ‪$persistenceSession;
47 
54 
58  protected ‪$dataMapFactory;
59 
63  protected ‪$queryFactory;
64 
68  protected ‪$objectManager;
69 
74 
78  protected ‪$configurationManager;
79 
83  protected ‪$query;
84 
89  public function ‪__construct(?‪QueryInterface ‪$query = null)
90  {
91  $this->query = ‪$query;
92  }
93 
97  public function ‪injectReflectionService(\‪TYPO3\CMS\‪Extbase\Reflection\ReflectionService ‪$reflectionService)
98  {
99  $this->reflectionService = ‪$reflectionService;
100  }
101 
105  public function ‪injectQomFactory(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Qom\QueryObjectModelFactory ‪$qomFactory)
106  {
107  $this->qomFactory = ‪$qomFactory;
108  }
109 
113  public function ‪injectPersistenceSession(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Session ‪$persistenceSession)
114  {
115  $this->persistenceSession = ‪$persistenceSession;
116  }
117 
121  public function ‪injectDataMapFactory(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\DataMapFactory ‪$dataMapFactory)
122  {
123  $this->dataMapFactory = ‪$dataMapFactory;
124  }
125 
129  public function ‪injectQueryFactory(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\QueryFactoryInterface ‪$queryFactory)
130  {
131  $this->queryFactory = ‪$queryFactory;
132  }
133 
137  public function ‪injectObjectManager(\‪TYPO3\CMS\‪Extbase\Object\ObjectManagerInterface ‪$objectManager)
138  {
139  $this->objectManager = ‪$objectManager;
140  }
141 
145  public function ‪injectSignalSlotDispatcher(\‪TYPO3\CMS\‪Extbase\SignalSlot\Dispatcher ‪$signalSlotDispatcher)
146  {
147  $this->signalSlotDispatcher = ‪$signalSlotDispatcher;
148  }
149 
153  public function ‪injectConfigurationManager(ConfigurationManagerInterface ‪$configurationManager)
154  {
155  $this->configurationManager = ‪$configurationManager;
156  }
157 
165  public function ‪map($className, array $rows)
166  {
167  $objects = [];
168  foreach ($rows as $row) {
169  $objects[] = $this->‪mapSingleRow($this->‪getTargetType($className, $row), $row);
170  }
171  return $objects;
172  }
173 
181  public function ‪getTargetType($className, array $row)
182  {
183  $dataMap = $this->‪getDataMap($className);
184  $targetType = $className;
185  if ($dataMap->getRecordTypeColumnName() !== null) {
186  foreach ($dataMap->getSubclasses() as $subclassName) {
187  $recordSubtype = $this->‪getDataMap($subclassName)->‪getRecordType();
188  if ((string)$row[$dataMap->getRecordTypeColumnName()] === (string)$recordSubtype) {
189  $targetType = $subclassName;
190  break;
191  }
192  }
193  }
194  return $targetType;
195  }
196 
204  protected function ‪mapSingleRow($className, array $row)
205  {
206  if ($this->persistenceSession->hasIdentifier($row['uid'], $className)) {
207  $object = $this->persistenceSession->getObjectByIdentifier($row['uid'], $className);
208  } else {
209  $object = $this->‪createEmptyObject($className);
210  $this->persistenceSession->registerObject($object, $row['uid']);
211  $this->‪thawProperties($object, $row);
212  $this->‪emitAfterMappingSingleRow($object);
213  $object->_memorizeCleanState();
214  $this->persistenceSession->registerReconstitutedEntity($object);
215  }
216  return $object;
217  }
218 
224  protected function ‪emitAfterMappingSingleRow(‪DomainObjectInterface $object)
225  {
226  $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterMappingSingleRow', [$object]);
227  }
228 
236  protected function ‪createEmptyObject($className)
237  {
238  // Note: The class_implements() function also invokes autoload to assure that the interfaces
239  // and the class are loaded. Would end up with __PHP_Incomplete_Class without it.
240  if (!in_array(\‪TYPO3\CMS\‪Extbase\DomainObject\DomainObjectInterface::class, class_implements($className))) {
241  throw new ‪CannotReconstituteObjectException('Cannot create empty instance of the class "' . $className
242  . '" because it does not implement the TYPO3\\CMS\\Extbase\\DomainObject\\DomainObjectInterface.', 1234386924);
243  }
244  $object = $this->objectManager->getEmptyObject($className);
245  return $object;
246  }
247 
256  protected function ‪thawProperties(‪DomainObjectInterface $object, array $row)
257  {
258  $className = get_class($object);
259  $classSchema = $this->reflectionService->getClassSchema($className);
260  $dataMap = $this->‪getDataMap($className);
261  $object->‪_setProperty('uid', (int)$row['uid']);
262  $object->‪_setProperty('pid', (int)($row['pid'] ?? 0));
263  $object->‪_setProperty('_localizedUid', (int)$row['uid']);
264  $object->‪_setProperty('_versionedUid', (int)$row['uid']);
265  if ($dataMap->getLanguageIdColumnName() !== null) {
266  $object->‪_setProperty('_languageUid', (int)$row[$dataMap->getLanguageIdColumnName()]);
267  if (isset($row['_LOCALIZED_UID'])) {
268  $object->‪_setProperty('_localizedUid', (int)$row['_LOCALIZED_UID']);
269  }
270  }
271  if (!empty($row['_ORIG_uid']) && !empty(‪$GLOBALS['TCA'][$dataMap->getTableName()]['ctrl']['versioningWS'])) {
272  $object->‪_setProperty('_versionedUid', (int)$row['_ORIG_uid']);
273  }
274  $properties = $object->‪_getProperties();
275  foreach ($properties as $propertyName => $propertyValue) {
276  if (!$dataMap->isPersistableProperty($propertyName)) {
277  continue;
278  }
279  $columnMap = $dataMap->getColumnMap($propertyName);
280  $columnName = $columnMap->getColumnName();
281 
282  $property = $classSchema->getProperty($propertyName);
283  if (empty($property)) {
284  throw new Exception\NonExistentPropertyException(
285  'The type of property ' . $className . '::' . $propertyName . ' could not be identified, ' .
286  'as property ' . $propertyName . ' is unknown to the ' . ClassSchema::class . ' instance of class ' .
287  $className . '. Please make sure said property exists and that you cleared all caches to trigger ' .
288  'a new build of said ' . ClassSchema::class . ' instance.',
289  1580056272
290  );
291  }
292 
293  $propertyType = $property['type'] ?? null;
294  if ($propertyType === null) {
295  throw new Exception\UnknownPropertyTypeException(
296  'The type of property ' . $className . '::' . $propertyName . ' could not be identified, therefore the desired value (' .
297  var_export($propertyValue, true) . ') cannot be mapped onto it. The type of a class property is usually defined via php doc blocks. ' .
298  'Make sure the property has a valid @var tag set which defines the type.',
299  1579965021
300  );
301  }
302  $propertyValue = null;
303  if (isset($row[$columnName])) {
304  switch ($propertyType) {
305  case 'integer':
306  $propertyValue = (int)$row[$columnName];
307  break;
308  case 'float':
309  $propertyValue = (double)$row[$columnName];
310  break;
311  case 'boolean':
312  $propertyValue = (bool)$row[$columnName];
313  break;
314  case 'string':
315  $propertyValue = (string)$row[$columnName];
316  break;
317  case 'array':
318  // $propertyValue = $this->mapArray($row[$columnName]); // Not supported, yet!
319  break;
320  case 'SplObjectStorage':
321  case Persistence\ObjectStorage::class:
322  $propertyValue = $this->‪mapResultToPropertyValue(
323  $object,
324  $propertyName,
325  $this->‪fetchRelated($object, $propertyName, $row[$columnName])
326  );
327  break;
328  default:
329  if (is_subclass_of($propertyType, \DateTimeInterface::class)) {
330  $propertyValue = $this->‪mapDateTime(
331  $row[$columnName],
332  $columnMap->getDateTimeStorageFormat(),
333  $propertyType
334  );
335  } elseif (‪TypeHandlingUtility::isCoreType($propertyType)) {
336  $propertyValue = $this->‪mapCoreType($propertyType, $row[$columnName]);
337  } else {
338  $propertyValue = $this->‪mapObjectToClassProperty(
339  $object,
340  $propertyName,
341  $row[$columnName]
342  );
343  }
344 
345  }
346  }
347  if ($propertyValue !== null) {
348  $object->‪_setProperty($propertyName, $propertyValue);
349  }
350  }
351  }
352 
360  protected function ‪mapCoreType($type, $value)
361  {
362  return new $type($value);
363  }
364 
374  protected function ‪mapDateTime($value, $storageFormat = null, $targetType = \DateTime::class)
375  {
376  $dateTimeTypes = ‪QueryHelper::getDateTimeTypes();
377 
378  if (empty($value) || $value === '0000-00-00' || $value === '0000-00-00 00:00:00' || $value === '00:00:00') {
379  // 0 -> NULL !!!
380  return null;
381  }
382  if (in_array($storageFormat, $dateTimeTypes, true)) {
383  // native date/datetime/time values are stored in UTC
384  $utcTimeZone = new \DateTimeZone('UTC');
385  $utcDateTime = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, $value, $utcTimeZone);
386  $currentTimeZone = new \DateTimeZone(date_default_timezone_get());
387  return $utcDateTime->setTimezone($currentTimeZone);
388  }
389  // integer timestamps are local server time
390  return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, date('c', (int)$value));
391  }
392 
402  public function ‪fetchRelated(‪DomainObjectInterface $parentObject, $propertyName, $fieldValue = '', $enableLazyLoading = true)
403  {
404  $propertyMetaData = $this->reflectionService->getClassSchema(get_class($parentObject))->getProperty($propertyName);
405  if ($enableLazyLoading === true && $propertyMetaData['annotations']['lazy']) {
406  if ($propertyMetaData['type'] === Persistence\ObjectStorage::class) {
407  $result = $this->objectManager->get(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\LazyObjectStorage::class, $parentObject, $propertyName, $fieldValue, $this);
408  } else {
409  if (empty($fieldValue)) {
410  $result = null;
411  } else {
412  $result = $this->objectManager->get(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\LazyLoadingProxy::class, $parentObject, $propertyName, $fieldValue, $this);
413  }
414  }
415  } else {
416  $result = $this->‪fetchRelatedEager($parentObject, $propertyName, $fieldValue);
417  }
418  return $result;
419  }
420 
429  protected function ‪fetchRelatedEager(‪DomainObjectInterface $parentObject, $propertyName, $fieldValue = '')
430  {
431  return $fieldValue === '' ? $this->‪getEmptyRelationValue($parentObject, $propertyName) : $this->‪getNonEmptyRelationValue($parentObject, $propertyName, $fieldValue);
432  }
433 
439  protected function ‪getEmptyRelationValue(‪DomainObjectInterface $parentObject, $propertyName)
440  {
441  $columnMap = $this->‪getDataMap(get_class($parentObject))->‪getColumnMap($propertyName);
442  $relatesToOne = $columnMap->‪getTypeOfRelation() == ‪ColumnMap::RELATION_HAS_ONE;
443  return $relatesToOne ? null : [];
444  }
445 
452  protected function ‪getNonEmptyRelationValue(‪DomainObjectInterface $parentObject, $propertyName, $fieldValue)
453  {
454  ‪$query = $this->‪getPreparedQuery($parentObject, $propertyName, $fieldValue);
455  return ‪$query->‪execute();
456  }
457 
466  protected function ‪getPreparedQuery(‪DomainObjectInterface $parentObject, $propertyName, $fieldValue = '')
467  {
468  $dataMap = $this->‪getDataMap(get_class($parentObject));
469  $columnMap = $dataMap->getColumnMap($propertyName);
470  $type = $this->‪getType(get_class($parentObject), $propertyName);
471  ‪$query = $this->queryFactory->create($type);
472  if ($this->query && ‪$query instanceof Persistence\Generic\‪Query) {
473  ‪$query->setParentQuery($this->query);
474  }
475  ‪$query->‪getQuerySettings()->setRespectStoragePage(false);
476  ‪$query->‪getQuerySettings()->setRespectSysLanguage(false);
477 
478  if ($this->configurationManager->isFeatureEnabled('consistentTranslationOverlayHandling')) {
479  //we always want to overlay relations as most of the time they are stored in db using default lang uids
480  ‪$query->‪getQuerySettings()->setLanguageOverlayMode(true);
481  if ($this->query) {
482  ‪$query->‪getQuerySettings()->setLanguageUid($this->query->getQuerySettings()->getLanguageUid());
483 
484  if ($dataMap->getLanguageIdColumnName() !== null && !$this->query->getQuerySettings()->getRespectSysLanguage()) {
485  //pass language of parent record to child objects, so they can be overlaid correctly in case
486  //e.g. findByUid is used.
487  //the languageUid is used for getRecordOverlay later on, despite RespectSysLanguage being false
488  $languageUid = (int)$parentObject->‪_getProperty('_languageUid');
489  ‪$query->‪getQuerySettings()->setLanguageUid($languageUid);
490  }
491  }
492  }
493 
494  if ($columnMap->getTypeOfRelation() === ‪ColumnMap::RELATION_HAS_MANY) {
495  if ($columnMap->getChildSortByFieldName() !== null) {
496  ‪$query->‪setOrderings([$columnMap->getChildSortByFieldName() => ‪Persistence\QueryInterface::ORDER_ASCENDING]);
497  }
498  } elseif ($columnMap->getTypeOfRelation() === ‪ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
499  ‪$query->‪setSource($this->‪getSource($parentObject, $propertyName));
500  if ($columnMap->getChildSortByFieldName() !== null) {
501  ‪$query->‪setOrderings([$columnMap->getChildSortByFieldName() => Persistence\‪QueryInterface::ORDER_ASCENDING]);
502  }
503  }
504  ‪$query->‪matching($this->‪getConstraint(‪$query, $parentObject, $propertyName, $fieldValue, $columnMap->getRelationTableMatchFields()));
505  return ‪$query;
506  }
507 
518  protected function ‪getConstraint(Persistence\QueryInterface ‪$query, DomainObjectInterface $parentObject, $propertyName, $fieldValue = '', $relationTableMatchFields = [])
519  {
520  $columnMap = $this->‪getDataMap(get_class($parentObject))->‪getColumnMap($propertyName);
521  if ($columnMap->getParentKeyFieldName() !== null) {
522  $constraint = ‪$query->‪equals($columnMap->getParentKeyFieldName(), $parentObject);
523  if ($columnMap->getParentTableFieldName() !== null) {
524  $constraint = ‪$query->‪logicalAnd(
525  $constraint,
526  ‪$query->‪equals($columnMap->getParentTableFieldName(), $this->getDataMap(get_class($parentObject))->getTableName())
527  );
528  }
529  } else {
530  $constraint = ‪$query->‪in('uid', \‪TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $fieldValue));
531  }
532  if (!empty($relationTableMatchFields)) {
533  foreach ($relationTableMatchFields as $relationTableMatchFieldName => $relationTableMatchFieldValue) {
534  $constraint = ‪$query->‪logicalAnd($constraint, ‪$query->‪equals($relationTableMatchFieldName, $relationTableMatchFieldValue));
535  }
536  }
537  return $constraint;
538  }
539 
547  protected function ‪getSource(‪DomainObjectInterface $parentObject, $propertyName)
548  {
549  $columnMap = $this->‪getDataMap(get_class($parentObject))->‪getColumnMap($propertyName);
550  $left = $this->qomFactory->selector(null, $columnMap->getRelationTableName());
551  $childClassName = $this->‪getType(get_class($parentObject), $propertyName);
552  $right = $this->qomFactory->selector($childClassName, $columnMap->getChildTableName());
553  $joinCondition = $this->qomFactory->equiJoinCondition($columnMap->getRelationTableName(), $columnMap->getChildKeyFieldName(), $columnMap->getChildTableName(), 'uid');
554  $source = $this->qomFactory->join($left, $right, Persistence\Generic\‪Query::JCR_JOIN_TYPE_INNER, $joinCondition);
555  return $source;
556  }
557 
573  protected function ‪mapObjectToClassProperty(‪DomainObjectInterface $parentObject, $propertyName, $fieldValue)
574  {
575  if ($this->‪propertyMapsByForeignKey($parentObject, $propertyName)) {
576  $result = $this->‪fetchRelated($parentObject, $propertyName, $fieldValue);
577  $propertyValue = $this->‪mapResultToPropertyValue($parentObject, $propertyName, $result);
578  } else {
579  if ($fieldValue === '') {
580  $propertyValue = $this->‪getEmptyRelationValue($parentObject, $propertyName);
581  } else {
582  $propertyMetaData = $this->reflectionService->getClassSchema(get_class($parentObject))->getProperty($propertyName);
583  if ($this->persistenceSession->hasIdentifier($fieldValue, $propertyMetaData['type'])) {
584  $propertyValue = $this->persistenceSession->getObjectByIdentifier($fieldValue, $propertyMetaData['type']);
585  } else {
586  $result = $this->‪fetchRelated($parentObject, $propertyName, $fieldValue);
587  $propertyValue = $this->‪mapResultToPropertyValue($parentObject, $propertyName, $result);
588  }
589  }
590  }
591 
592  return $propertyValue;
593  }
594 
602  protected function ‪propertyMapsByForeignKey(‪DomainObjectInterface $parentObject, $propertyName)
603  {
604  $columnMap = $this->‪getDataMap(get_class($parentObject))->‪getColumnMap($propertyName);
605  return $columnMap->‪getParentKeyFieldName() !== null;
606  }
607 
616  public function ‪mapResultToPropertyValue(‪DomainObjectInterface $parentObject, $propertyName, $result)
617  {
618  $propertyValue = null;
619  if ($result instanceof Persistence\Generic\‪LoadingStrategyInterface) {
620  $propertyValue = $result;
621  } else {
622  $propertyMetaData = $this->reflectionService->getClassSchema(get_class($parentObject))->getProperty($propertyName);
623  if (in_array($propertyMetaData['type'], ['array', 'ArrayObject', 'SplObjectStorage', Persistence\ObjectStorage::class], true)) {
624  $objects = [];
625  foreach ($result as $value) {
626  $objects[] = $value;
627  }
628  if ($propertyMetaData['type'] === 'ArrayObject') {
629  $propertyValue = new \ArrayObject($objects);
630  } elseif ($propertyMetaData['type'] === Persistence\ObjectStorage::class) {
631  $propertyValue = new ‪Persistence\ObjectStorage();
632  foreach ($objects as $object) {
633  $propertyValue->attach($object);
634  }
635  $propertyValue->_memorizeCleanState();
636  } else {
637  $propertyValue = $objects;
638  }
639  } elseif (strpbrk($propertyMetaData['type'], '_\\') !== false) {
640  if (is_object($result) && $result instanceof Persistence\QueryResultInterface) {
641  $propertyValue = $result->getFirst();
642  } else {
643  $propertyValue = $result;
644  }
645  }
646  }
647  return $propertyValue;
648  }
649 
658  public function ‪countRelated(‪DomainObjectInterface $parentObject, $propertyName, $fieldValue = '')
659  {
660  ‪$query = $this->‪getPreparedQuery($parentObject, $propertyName, $fieldValue);
661  return ‪$query->‪execute()->count();
662  }
663 
672  public function ‪isPersistableProperty($className, $propertyName)
673  {
674  $dataMap = $this->‪getDataMap($className);
675  return $dataMap->isPersistableProperty($propertyName);
676  }
677 
685  public function ‪getDataMap($className)
686  {
687  if (!is_string($className) || $className === '') {
688  throw new ‪Persistence\Generic\Exception('No class name was given to retrieve the Data Map for.', 1251315965);
689  }
690  return $this->dataMapFactory->buildDataMap($className);
691  }
692 
699  public function ‪convertClassNameToTableName($className)
700  {
701  return $this->‪getDataMap($className)->‪getTableName();
702  }
703 
711  public function ‪convertPropertyNameToColumnName($propertyName, $className = null)
712  {
713  if (!empty($className)) {
714  $dataMap = $this->‪getDataMap($className);
715  if ($dataMap !== null) {
716  $columnMap = $dataMap->getColumnMap($propertyName);
717  if ($columnMap !== null) {
718  return $columnMap->getColumnName();
719  }
720  }
721  }
722  return \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($propertyName);
723  }
724 
733  public function ‪getType($parentClassName, $propertyName)
734  {
735  $propertyMetaData = $this->reflectionService->getClassSchema($parentClassName)->getProperty($propertyName);
736  if (!empty($propertyMetaData['elementType'])) {
737  $type = $propertyMetaData['elementType'];
738  } elseif (!empty($propertyMetaData['type'])) {
739  $type = $propertyMetaData['type'];
740  } else {
741  throw new UnexpectedTypeException('Could not determine the child object type.', 1251315967);
742  }
743  return $type;
744  }
745 
756  public function ‪getPlainValue($input, $columnMap = null)
757  {
758  if ($input === null) {
759  return 'NULL';
760  }
761  if ($input instanceof Persistence\Generic\LazyLoadingProxy) {
762  $input = $input->_loadRealInstance();
763  }
764 
765  if (is_bool($input)) {
766  $parameter = (int)$input;
767  } elseif (is_int($input)) {
768  $parameter = $input;
769  } elseif ($input instanceof \DateTimeInterface) {
770  if ($columnMap !== null && $columnMap->getDateTimeStorageFormat() !== null) {
771  $storageFormat = $columnMap->getDateTimeStorageFormat();
772  $timeZoneToStore = clone $input;
773  // set to UTC to store in database
774  $timeZoneToStore->setTimezone(new \DateTimeZone('UTC'));
775  switch ($storageFormat) {
776  case 'datetime':
777  $parameter = $timeZoneToStore->format('Y-m-d H:i:s');
778  break;
779  case 'date':
780  $parameter = $timeZoneToStore->format('Y-m-d');
781  break;
782  case 'time':
783  $parameter = $timeZoneToStore->format('H:i');
784  break;
785  default:
786  throw new \InvalidArgumentException('Column map DateTime format "' . $storageFormat . '" is unknown. Allowed values are date, datetime or time.', 1395353470);
787  }
788  } else {
789  $parameter = $input->format('U');
790  }
791  } elseif ($input instanceof DomainObjectInterface) {
792  $parameter = (int)$input->getUid();
794  $plainValueArray = [];
795  foreach ($input as $inputElement) {
796  $plainValueArray[] = $this->‪getPlainValue($inputElement, $columnMap);
797  }
798  $parameter = implode(',', $plainValueArray);
799  } elseif (is_object($input)) {
801  $parameter = (string)$input;
802  } else {
803  throw new UnexpectedTypeException('An object of class "' . get_class($input) . '" could not be converted to a plain value.', 1274799934);
804  }
805  } else {
806  $parameter = (string)$input;
807  }
808  return $parameter;
809  }
810 }
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$qomFactory
‪TYPO3 CMS Extbase Persistence Generic Qom QueryObjectModelFactory $qomFactory
Definition: DataMapper.php:39
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\map
‪array map($className, array $rows)
Definition: DataMapper.php:155
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\mapDateTime
‪DateTimeInterface mapDateTime($value, $storageFormat=null, $targetType=\DateTime::class)
Definition: DataMapper.php:364
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\mapResultToPropertyValue
‪mixed mapResultToPropertyValue(DomainObjectInterface $parentObject, $propertyName, $result)
Definition: DataMapper.php:606
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectSignalSlotDispatcher
‪injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher)
Definition: DataMapper.php:135
‪TYPO3\CMS\Extbase\Persistence\Generic\LoadingStrategyInterface
Definition: LoadingStrategyInterface.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap\getColumnMap
‪TYPO3 CMS Extbase Persistence Generic Mapper ColumnMap null getColumnMap($propertyName)
Definition: DataMap.php:225
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap
Definition: DataMap.php:22
‪TYPO3\CMS\Extbase\Persistence\QueryInterface
Definition: QueryInterface.php:26
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\equals
‪TYPO3 CMS Extbase Persistence Generic Qom ComparisonInterface equals($propertyName, $operand, $caseSensitive=true)
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectDataMapFactory
‪injectDataMapFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory $dataMapFactory)
Definition: DataMapper.php:111
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$pageSelectObject
‪TYPO3 CMS Frontend Page PageRepository $pageSelectObject
Definition: DataMapper.php:49
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap\getTableName
‪string getTableName()
Definition: DataMap.php:164
‪TYPO3
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getType
‪string getType($parentClassName, $propertyName)
Definition: DataMapper.php:723
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$persistenceSession
‪TYPO3 CMS Extbase Persistence Generic Session $persistenceSession
Definition: DataMapper.php:43
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getPlainValue
‪int string getPlainValue($input, $columnMap=null)
Definition: DataMapper.php:746
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\convertPropertyNameToColumnName
‪string convertPropertyNameToColumnName($propertyName, $className=null)
Definition: DataMapper.php:701
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\setOrderings
‪TYPO3 CMS Extbase Persistence QueryInterface setOrderings(array $orderings)
‪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\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getEmptyRelationValue
‪array null getEmptyRelationValue(DomainObjectInterface $parentObject, $propertyName)
Definition: DataMapper.php:429
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\mapObjectToClassProperty
‪mixed mapObjectToClassProperty(DomainObjectInterface $parentObject, $propertyName, $fieldValue)
Definition: DataMapper.php:563
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getTargetType
‪string getTargetType($className, array $row)
Definition: DataMapper.php:171
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
Definition: DataMapper.php:32
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\createEmptyObject
‪object createEmptyObject($className)
Definition: DataMapper.php:226
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\propertyMapsByForeignKey
‪bool propertyMapsByForeignKey(DomainObjectInterface $parentObject, $propertyName)
Definition: DataMapper.php:592
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_MANY
‪const RELATION_HAS_MANY
Definition: ColumnMap.php:28
‪TYPO3\CMS\Extbase\Object\ObjectManagerInterface
Definition: ObjectManagerInterface.php:23
‪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\Persistence\Generic\Mapper\DataMapFactory
Definition: DataMapFactory.php:24
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$signalSlotDispatcher
‪TYPO3 CMS Extbase SignalSlot Dispatcher $signalSlotDispatcher
Definition: DataMapper.php:65
‪TYPO3\CMS\Extbase\Persistence
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$configurationManager
‪ConfigurationManagerInterface $configurationManager
Definition: DataMapper.php:69
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\in
‪ComparisonInterface in($propertyName, $operand)
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\mapSingleRow
‪object mapSingleRow($className, array $row)
Definition: DataMapper.php:194
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectObjectManager
‪injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
Definition: DataMapper.php:127
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_ASCENDING
‪const ORDER_ASCENDING
Definition: QueryInterface.php:95
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\thawProperties
‪thawProperties(DomainObjectInterface $object, array $row)
Definition: DataMapper.php:246
‪TYPO3\CMS\Extbase\Utility\TypeHandlingUtility
Definition: TypeHandlingUtility.php:19
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap\getRecordType
‪string getRecordType()
Definition: DataMap.php:184
‪TYPO3\CMS\Core\Database\Query\QueryHelper
Definition: QueryHelper.php:30
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$reflectionService
‪TYPO3 CMS Extbase Reflection ReflectionService $reflectionService
Definition: DataMapper.php:35
‪TYPO3\CMS\Extbase\Persistence\Generic\Query\JCR_JOIN_TYPE_INNER
‪const JCR_JOIN_TYPE_INNER
Definition: Query.php:27
‪TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface
Definition: QueryFactoryInterface.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectQomFactory
‪injectQomFactory(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory $qomFactory)
Definition: DataMapper.php:95
‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface
Definition: DomainObjectInterface.php:26
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\fetchRelatedEager
‪mixed fetchRelatedEager(DomainObjectInterface $parentObject, $propertyName, $fieldValue='')
Definition: DataMapper.php:419
‪TYPO3\CMS\Core\Database\Query\QueryHelper\getDateTimeTypes
‪static array getDateTimeTypes()
Definition: QueryHelper.php:200
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectQueryFactory
‪injectQueryFactory(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory)
Definition: DataMapper.php:119
‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface\_getProperty
‪mixed _getProperty($propertyName)
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\matching
‪TYPO3 CMS Extbase Persistence QueryInterface matching($constraint)
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$queryFactory
‪TYPO3 CMS Extbase Persistence Generic QueryFactoryInterface $queryFactory
Definition: DataMapper.php:57
‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface\_getProperties
‪array _getProperties()
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\logicalAnd
‪AndInterface logicalAnd($constraint1)
‪TYPO3\CMS\Extbase\Persistence\Generic\Session
Definition: Session.php:24
‪TYPO3\CMS\Extbase\Persistence\QueryResultInterface
Definition: QueryResultInterface.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\emitAfterMappingSingleRow
‪emitAfterMappingSingleRow(DomainObjectInterface $object)
Definition: DataMapper.php:214
‪TYPO3\CMS\Extbase\Utility\TypeHandlingUtility\isCoreType
‪static bool isCoreType($type)
Definition: TypeHandlingUtility.php:114
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\convertClassNameToTableName
‪string convertClassNameToTableName($className)
Definition: DataMapper.php:689
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$objectManager
‪TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
Definition: DataMapper.php:61
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\countRelated
‪int countRelated(DomainObjectInterface $parentObject, $propertyName, $fieldValue='')
Definition: DataMapper.php:648
‪TYPO3\CMS\Extbase\Utility\TypeHandlingUtility\isValidTypeForMultiValueComparison
‪static bool isValidTypeForMultiValueComparison($value)
Definition: TypeHandlingUtility.php:148
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\fetchRelated
‪TYPO3 CMS Extbase Persistence Generic LazyObjectStorage Persistence QueryResultInterface fetchRelated(DomainObjectInterface $parentObject, $propertyName, $fieldValue='', $enableLazyLoading=true)
Definition: DataMapper.php:392
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\isPersistableProperty
‪bool isPersistableProperty($className, $propertyName)
Definition: DataMapper.php:662
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnexpectedTypeException
Definition: UnexpectedTypeException.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\__construct
‪__construct(?QueryInterface $query=null)
Definition: DataMapper.php:79
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectPersistenceSession
‪injectPersistenceSession(\TYPO3\CMS\Extbase\Persistence\Generic\Session $persistenceSession)
Definition: DataMapper.php:103
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectConfigurationManager
‪injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
Definition: DataMapper.php:143
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getQuerySettings
‪TYPO3 CMS Extbase Persistence Generic QuerySettingsInterface getQuerySettings()
‪TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy
Definition: LazyLoadingProxy.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$query
‪QueryInterface $query
Definition: DataMapper.php:73
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\setSource
‪setSource(Generic\Qom\SourceInterface $source)
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getNonEmptyRelationValue
‪Persistence QueryResultInterface getNonEmptyRelationValue(DomainObjectInterface $parentObject, $propertyName, $fieldValue)
Definition: DataMapper.php:442
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\$dataMapFactory
‪TYPO3 CMS Extbase Persistence Generic Mapper DataMapFactory $dataMapFactory
Definition: DataMapper.php:53
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\execute
‪TYPO3 CMS Extbase Persistence QueryResultInterface array execute($returnRawQueryResult=false)
‪TYPO3\CMS\Extbase\Persistence\Generic\Query
Definition: Query.php:23
‪TYPO3\CMS\Extbase\Reflection\ClassSchema
Definition: ClassSchema.php:41
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getPreparedQuery
‪Persistence QueryInterface getPreparedQuery(DomainObjectInterface $parentObject, $propertyName, $fieldValue='')
Definition: DataMapper.php:456
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper
Definition: ColumnMap.php:2
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\getTypeOfRelation
‪string getTypeOfRelation()
Definition: ColumnMap.php:177
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\injectReflectionService
‪injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
Definition: DataMapper.php:87
‪TYPO3\CMS\Extbase\Object\Exception\CannotReconstituteObjectException
Definition: CannotReconstituteObjectException.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getConstraint
‪TYPO3 CMS Extbase Persistence Generic Qom ConstraintInterface getConstraint(Persistence\QueryInterface $query, DomainObjectInterface $parentObject, $propertyName, $fieldValue='', $relationTableMatchFields=[])
Definition: DataMapper.php:508
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getSource
‪TYPO3 CMS Extbase Persistence Generic Qom SourceInterface getSource(DomainObjectInterface $parentObject, $propertyName)
Definition: DataMapper.php:537
‪TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface\_setProperty
‪_setProperty($propertyName, $value)
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\getDataMap
‪DataMap getDataMap($className)
Definition: DataMapper.php:675
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\getParentKeyFieldName
‪string getParentKeyFieldName()
Definition: ColumnMap.php:353
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper\mapCoreType
‪TYPO3 CMS Core Type TypeInterface mapCoreType($type, $value)
Definition: DataMapper.php:350