TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory:
TYPO3\CMS\Core\SingletonInterface Tx_Extbase_Persistence_Mapper_DataMapFactory

Public Member Functions

 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

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! 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\DataMapFactory::addMetaDataColumnNames ( \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap  $dataMap,
  $tableName 
)
protected
Parameters
DataMap$dataMap
string$tableName
Returns
DataMap

Definition at line 212 of file DataMapFactory.php.

References $GLOBALS.

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

◆ buildDataMap()

◆ createColumnMap()

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

Creates the ColumnMap object for the given columnName and propertyName

Parameters
string$columnName
string$propertyName
Returns
ColumnMap

Definition at line 412 of file DataMapFactory.php.

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

◆ getColumnsDefinition()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::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 203 of file DataMapFactory.php.

References $GLOBALS.

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

◆ getControlSection()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::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 193 of file DataMapFactory.php.

References $GLOBALS.

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

◆ initializeObject()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::initializeObject ( )

Lifecycle method

Returns
void

Definition at line 56 of file DataMapFactory.php.

◆ resolveSubclassesRecursive()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::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 175 of file DataMapFactory.php.

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

◆ resolveTableName()

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

Resolve the table name for the given class name

Parameters
string$className
Returns
string The table name

Definition at line 150 of file DataMapFactory.php.

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

◆ setFieldEvaluations()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::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 309 of file DataMapFactory.php.

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

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

◆ setManyToManyRelation()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::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

Definition at line 373 of file DataMapFactory.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\getControlSection(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\getRelationTableName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_AND_BELONGS_TO_MANY, TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setChildKeyFieldName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setChildSortByFieldName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setChildTableName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setChildTableWhereStatement(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setParentKeyFieldName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setRelationTableInsertFields(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setRelationTableMatchFields(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setRelationTableName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setRelationTablePageIdColumnName(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setRelationTableWhereStatement(), and TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setTypeOfRelation().

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

◆ setOneToManyRelation()

◆ setOneToOneRelation()

◆ setRelations()

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::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 282 of file DataMapFactory.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_HAS_MANY, TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\RELATION_NONE, TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\setManyToManyRelation(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\setOneToManyRelation(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\setOneToOneRelation(), and TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap\setTypeOfRelation().

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

◆ setType()

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

Member Data Documentation

◆ $cacheManager

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

Definition at line 44 of file DataMapFactory.php.

◆ $configurationManager

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

Definition at line 32 of file DataMapFactory.php.

◆ $dataMapCache

TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory::$dataMapCache
protected

Definition at line 49 of file DataMapFactory.php.

◆ $objectManager

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

Definition at line 38 of file DataMapFactory.php.

◆ $reflectionService

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

Definition at line 26 of file DataMapFactory.php.