‪TYPO3CMS  10.4
TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct (ReflectionService $reflectionService, ConfigurationManagerInterface $configurationManager, ObjectManagerInterface $objectManager, CacheManager $cacheManager, ClassesConfigurationFactory $classesConfigurationFactory)
 
TYPO3 CMS Extbase Persistence Generic Mapper DataMap buildDataMap (string $className)
 

Protected Member Functions

TYPO3 CMS Extbase Persistence Generic Mapper DataMap buildDataMapInternal (string $className)
 
string resolveTableName (string $className)
 
array null getControlSection (string $tableName)
 
array getColumnsDefinition (string $tableName)
 
DataMap addMetaDataColumnNames (DataMap $dataMap, string $tableName)
 
ColumnMap setType (ColumnMap $columnMap, array $columnConfiguration)
 
ColumnMap setRelations (ColumnMap $columnMap, ?array $columnConfiguration, ?string $type, ?string $elementType)
 
ColumnMap setFieldEvaluations (ColumnMap $columnMap, array $columnConfiguration=null)
 
ColumnMap setOneToOneRelation (ColumnMap $columnMap, array $columnConfiguration=null)
 
ColumnMap setOneToManyRelation (ColumnMap $columnMap, array $columnConfiguration=null)
 
ColumnMap setManyToManyRelation (ColumnMap $columnMap, array $columnConfiguration=null)
 
ColumnMap createColumnMap (string $columnName, string $propertyName)
 

Protected Attributes

TYPO3 CMS Extbase Reflection ReflectionService $reflectionService
 
TYPO3 CMS Extbase Configuration ConfigurationManagerInterface $configurationManager
 
TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
TYPO3 CMS Core Cache CacheManager $cacheManager
 
TYPO3 CMS Core Cache Frontend FrontendInterface $dataMapCache
 
array $dataMaps = array( )
 

Private Attributes

ClassesConfiguration $classesConfiguration
 

Detailed Description

A factory for a data map to map a single table configured in $TCA on a domain object.

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 41 of file DataMapFactory.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::__construct ( ReflectionService  $reflectionService,
ConfigurationManagerInterface  $configurationManager,
ObjectManagerInterface  $objectManager,
CacheManager  $cacheManager,
ClassesConfigurationFactory  $classesConfigurationFactory 
)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface$configurationManager
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager
\TYPO3\CMS\Core\Cache\CacheManager$cacheManager

Definition at line 79 of file DataMapFactory.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\$cacheManager, TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\$configurationManager, TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\$objectManager, TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\$reflectionService, TYPO3\CMS\Extbase\Persistence\ClassesConfigurationFactory\createClassesConfiguration(), and TYPO3\CMS\Core\Cache\CacheManager\getCache().

Member Function Documentation

◆ addMetaDataColumnNames()

DataMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::addMetaDataColumnNames ( DataMap  $dataMap,
string  $tableName 
)
protected

◆ buildDataMap()

TYPO3 CMS Extbase Persistence Generic Mapper DataMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::buildDataMap ( string  $className)

Builds a data map by adding column maps for all the configured columns in the $TCA. It also resolves the type of values the column is holding and the typo of relation the column represents.

Parameters
string$className‪The class name you want to fetch the Data Map for
Returns
‪\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap The data map

Definition at line 103 of file DataMapFactory.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\buildDataMapInternal(), and TYPO3\CMS\Core\Core\Environment\getProjectPath().

◆ buildDataMapInternal()

TYPO3 CMS Extbase Persistence Generic Mapper DataMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::buildDataMapInternal ( string  $className)
protected

◆ createColumnMap()

ColumnMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::createColumnMap ( string  $columnName,
string  $propertyName 
)
protected

Creates the ColumnMap object for the given columnName and propertyName

Parameters
string$columnName
string$propertyName
Returns
ColumnMap

Definition at line 471 of file DataMapFactory.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\buildDataMapInternal().

◆ getColumnsDefinition()

array TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::getColumnsDefinition ( string  $tableName)
protected

Returns the TCA columns array of the specified table

Parameters
string$tableName‪An optional table name to fetch the columns definition from
Returns
‪array The TCA columns definition

Definition at line 219 of file DataMapFactory.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\buildDataMapInternal().

◆ getControlSection()

array null TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::getControlSection ( string  $tableName)
protected

Returns the TCA ctrl section of the specified table; or NULL if not set

Parameters
string$tableName‪An optional table name to fetch the columns definition from
Returns
‪array|null The TCA columns definition

Definition at line 206 of file DataMapFactory.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\setManyToManyRelation().

◆ resolveTableName()

string TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::resolveTableName ( string  $className)
protected

Resolve the table name for the given class name

Parameters
string$className
Returns
‪string The table name

Definition at line 185 of file DataMapFactory.php.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\buildDataMapInternal().

◆ setFieldEvaluations()

ColumnMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::setFieldEvaluations ( ColumnMap  $columnMap,
array  $columnConfiguration = null 
)
protected

Sets field evaluations based on $TCA column configuration.

Parameters
ColumnMap$columnMap‪The column map
array | null$columnConfiguration‪The column configuration from $TCA
Returns
ColumnMap

Definition at line 348 of file DataMapFactory.php.

References TYPO3\CMS\Core\Database\Query\QueryHelper\getDateTimeTypes(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setDateTimeStorageFormat(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\buildDataMapInternal().

◆ setManyToManyRelation()

ColumnMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::setManyToManyRelation ( ColumnMap  $columnMap,
array  $columnConfiguration = null 
)
protected

◆ setOneToManyRelation()

◆ setOneToOneRelation()

◆ setRelations()

ColumnMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::setRelations ( ColumnMap  $columnMap,
?array  $columnConfiguration,
?string  $type,
?string  $elementType 
)
protected

◆ setType()

ColumnMap TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::setType ( ColumnMap  $columnMap,
array  $columnConfiguration 
)
protected

Member Data Documentation

◆ $cacheManager

TYPO3 CMS Core Cache CacheManager TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$cacheManager
protected

◆ $classesConfiguration

ClassesConfiguration TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$classesConfiguration
private

Definition at line 71 of file DataMapFactory.php.

◆ $configurationManager

TYPO3 CMS Extbase Configuration ConfigurationManagerInterface TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$configurationManager
protected

◆ $dataMapCache

TYPO3 CMS Core Cache Frontend FrontendInterface TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$dataMapCache
protected

Definition at line 61 of file DataMapFactory.php.

◆ $dataMaps

array TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$dataMaps = array( )
protected

Runtime cache for data maps, to reduce number of calls to cache backend.

Definition at line 67 of file DataMapFactory.php.

◆ $objectManager

TYPO3 CMS Extbase Object ObjectManagerInterface TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$objectManager
protected

◆ $reflectionService

TYPO3 CMS Extbase Reflection ReflectionService TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$reflectionService
protected