TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DataMapFactory Class Reference
Inheritance diagram for DataMapFactory:
SingletonInterface

Public Member Functions

 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 injectConfigurationManager (\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectCacheManager (\TYPO3\CMS\Core\Cache\CacheManager $cacheManager)
 
 initializeObject ()
 
 buildDataMap ($className)
 

Protected Member Functions

 resolveTableName ($className)
 
 resolveSubclassesRecursive (array $classesConfiguration, array $subclasses)
 
 getControlSection ($tableName)
 
 getColumnsDefinition ($tableName)
 
 addMetaDataColumnNames (\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap $dataMap, $tableName)
 
 setType (ColumnMap $columnMap, $columnConfiguration)
 
 setRelations (ColumnMap $columnMap, $columnConfiguration, $propertyMetaData)
 
 setFieldEvaluations (ColumnMap $columnMap, array $columnConfiguration=null)
 
 setOneToOneRelation (ColumnMap $columnMap, $columnConfiguration)
 
 setOneToManyRelation (ColumnMap $columnMap, $columnConfiguration)
 
 setManyToManyRelation (ColumnMap $columnMap, $columnConfiguration)
 
 createColumnMap ($columnName, $propertyName)
 

Protected Attributes

 $reflectionService
 
 $configurationManager
 
 $objectManager
 
 $cacheManager
 
 $dataMapCache
 

Detailed Description

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

Definition at line 20 of file DataMapFactory.php.

Member Function Documentation

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

Definition at line 248 of file DataMapFactory.php.

References $GLOBALS.

buildDataMap (   $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$classNameThe class name you want to fetch the Data Map for
Returns
The data map

Definition at line 97 of file DataMapFactory.php.

createColumnMap (   $columnName,
  $propertyName 
)
protected

Creates the ColumnMap object for the given columnName and propertyName

Parameters
string$columnName
string$propertyName
Returns
ColumnMap

Definition at line 457 of file DataMapFactory.php.

getColumnsDefinition (   $tableName)
protected

Returns the TCA columns array of the specified table

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

Definition at line 238 of file DataMapFactory.php.

References $GLOBALS.

getControlSection (   $tableName)
protected

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

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

Definition at line 227 of file DataMapFactory.php.

References $GLOBALS.

Referenced by DataMapFactory\setManyToManyRelation().

initializeObject ( )

Lifecycle method

Returns
void

Definition at line 84 of file DataMapFactory.php.

injectCacheManager ( \TYPO3\CMS\Core\Cache\CacheManager  $cacheManager)
Parameters
\TYPO3\CMS\Core\Cache\CacheManager$cacheManager

Definition at line 74 of file DataMapFactory.php.

References DataMapFactory\$cacheManager.

injectConfigurationManager ( \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface  $configurationManager)
Parameters
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface$configurationManager

Definition at line 58 of file DataMapFactory.php.

References DataMapFactory\$configurationManager.

injectObjectManager ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)
Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager

Definition at line 66 of file DataMapFactory.php.

References DataMapFactory\$objectManager.

injectReflectionService ( \TYPO3\CMS\Extbase\Reflection\ReflectionService  $reflectionService)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService

Definition at line 50 of file DataMapFactory.php.

References DataMapFactory\$reflectionService.

resolveSubclassesRecursive ( array  $classesConfiguration,
array  $subclasses 
)
protected

Resolves all subclasses for the given set of (sub-)classes. The whole classes configuration is used to determine all subclasses recursively.

Parameters
array$classesConfigurationThe framework configuration part [persistence][classes].
array$subclassesAn array of subclasses defined via TypoScript
Returns
array An numeric array that contains all available subclasses-strings as values.

Definition at line 208 of file DataMapFactory.php.

resolveTableName (   $className)
protected

Resolve the table name for the given class name

Parameters
string$className
Returns
string The table name

Definition at line 182 of file DataMapFactory.php.

setFieldEvaluations ( ColumnMap  $columnMap,
array  $columnConfiguration = null 
)
protected

Sets field evaluations based on $TCA column configuration.

Parameters
ColumnMap$columnMapThe column map
NULL | array$columnConfigurationThe column configuration from $TCA
Returns
ColumnMap

Definition at line 350 of file DataMapFactory.php.

References ColumnMap\setDateTimeStorageFormat().

setManyToManyRelation ( ColumnMap  $columnMap,
  $columnConfiguration 
)
protected

This method sets the configuration for a m:n relation based on the $TCA column configuration

Parameters
string | ColumnMap$columnMapThe column map
string$columnConfigurationThe column configuration from $TCA
Exceptions
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnsupportedRelationException
Returns
ColumnMap

Definition at line 417 of file DataMapFactory.php.

References DataMapFactory\getControlSection(), ColumnMap\getRelationTableName(), ColumnMap\RELATION_HAS_AND_BELONGS_TO_MANY, ColumnMap\setChildKeyFieldName(), ColumnMap\setChildSortByFieldName(), ColumnMap\setChildTableName(), ColumnMap\setChildTableWhereStatement(), ColumnMap\setParentKeyFieldName(), ColumnMap\setRelationTableInsertFields(), ColumnMap\setRelationTableMatchFields(), ColumnMap\setRelationTableName(), ColumnMap\setRelationTablePageIdColumnName(), ColumnMap\setRelationTableWhereStatement(), and ColumnMap\setTypeOfRelation().

Referenced by DataMapFactory\setRelations().

setOneToManyRelation ( ColumnMap  $columnMap,
  $columnConfiguration 
)
protected

This method sets the configuration for a 1:n relation based on the $TCA column configuration

Parameters
string | ColumnMap$columnMapThe column map
string$columnConfigurationThe column configuration from $TCA
Returns
ColumnMap

Definition at line 394 of file DataMapFactory.php.

References ColumnMap\RELATION_HAS_MANY, ColumnMap\setChildSortByFieldName(), ColumnMap\setChildTableName(), ColumnMap\setChildTableWhereStatement(), ColumnMap\setParentKeyFieldName(), ColumnMap\setParentTableFieldName(), ColumnMap\setRelationTableMatchFields(), and ColumnMap\setTypeOfRelation().

Referenced by DataMapFactory\setRelations().

setOneToOneRelation ( ColumnMap  $columnMap,
  $columnConfiguration 
)
protected

This method sets the configuration for a 1:1 relation based on the $TCA column configuration

Parameters
string | ColumnMap$columnMapThe column map
string$columnConfigurationThe column configuration from $TCA
Returns
ColumnMap

Definition at line 372 of file DataMapFactory.php.

References ColumnMap\RELATION_HAS_ONE, ColumnMap\setChildSortByFieldName(), ColumnMap\setChildTableName(), ColumnMap\setChildTableWhereStatement(), ColumnMap\setParentKeyFieldName(), ColumnMap\setParentTableFieldName(), ColumnMap\setRelationTableMatchFields(), and ColumnMap\setTypeOfRelation().

Referenced by DataMapFactory\setRelations().

setRelations ( ColumnMap  $columnMap,
  $columnConfiguration,
  $propertyMetaData 
)
protected

This method tries to determine the type of type of relation to other tables and sets it based on the $TCA column configuration

Parameters
ColumnMap$columnMapThe column map
string$columnConfigurationThe column configuration from $TCA
array$propertyMetaDataThe property metadata as delivered by the reflection service
Returns
ColumnMap

Definition at line 323 of file DataMapFactory.php.

References elseif, ColumnMap\RELATION_HAS_MANY, ColumnMap\RELATION_NONE, DataMapFactory\setManyToManyRelation(), DataMapFactory\setOneToManyRelation(), DataMapFactory\setOneToOneRelation(), and ColumnMap\setTypeOfRelation().

setType ( ColumnMap  $columnMap,
  $columnConfiguration 
)
protected

Set the table column type

Parameters
ColumnMap$columnMap
array$columnConfiguration
Returns
ColumnMap

Definition at line 304 of file DataMapFactory.php.

References ColumnMap\setInternalType(), and ColumnMap\setType().

Member Data Documentation

$cacheManager
protected

Definition at line 40 of file DataMapFactory.php.

Referenced by DataMapFactory\injectCacheManager().

$configurationManager
protected

Definition at line 30 of file DataMapFactory.php.

Referenced by DataMapFactory\injectConfigurationManager().

$dataMapCache
protected

Definition at line 45 of file DataMapFactory.php.

$objectManager
protected

Definition at line 35 of file DataMapFactory.php.

Referenced by DataMapFactory\injectObjectManager().

$reflectionService
protected

Definition at line 25 of file DataMapFactory.php.

Referenced by DataMapFactory\injectReflectionService().