![]() |
TYPO3
7.6
|
Protected Member Functions | |
mapSingleRow ($className, array $row) | |
emitAfterMappingSingleRow (DomainObjectInterface $object) | |
createEmptyObject ($className) | |
thawProperties (DomainObjectInterface $object, array $row) | |
mapCoreType ($type, $value) | |
mapDateTime ($value, $storageFormat=null, $targetType= 'DateTime') | |
fetchRelatedEager (DomainObjectInterface $parentObject, $propertyName, $fieldValue= '') | |
getEmptyRelationValue (DomainObjectInterface $parentObject, $propertyName) | |
getNonEmptyRelationValue (DomainObjectInterface $parentObject, $propertyName, $fieldValue) | |
getPreparedQuery (DomainObjectInterface $parentObject, $propertyName, $fieldValue= '') | |
getConstraint (Persistence\QueryInterface $query, DomainObjectInterface $parentObject, $propertyName, $fieldValue= '', $relationTableMatchFields=array()) | |
getSource (DomainObjectInterface $parentObject, $propertyName) | |
mapObjectToClassProperty (DomainObjectInterface $parentObject, $propertyName, $fieldValue) | |
propertyMapsByForeignKey (DomainObjectInterface $parentObject, $propertyName) | |
getPlainStringValue ($value, $callback=null, array $additionalParameters=array()) | |
Protected Attributes | |
$reflectionService | |
$qomFactory | |
$persistenceSession | |
$pageSelectObject | |
$dataMaps = array() | |
$dataMapFactory | |
$queryFactory | |
$objectManager | |
$signalSlotDispatcher | |
A mapper to map database tables configured in $TCA on domain objects.
Definition at line 26 of file DataMapper.php.
convertClassNameToTableName | ( | $className | ) |
Returns the selector (table) name for a given class name.
string | $className |
Definition at line 628 of file DataMapper.php.
References DataMapper\getDataMap().
convertPropertyNameToColumnName | ( | $propertyName, | |
$className = null |
|||
) |
Returns the column name for a given property name of the specified class.
string | $propertyName | |
string | $className |
Definition at line 640 of file DataMapper.php.
References DataMapper\getDataMap().
countRelated | ( | DomainObjectInterface | $parentObject, |
$propertyName, | |||
$fieldValue = '' |
|||
) |
Counts the number of related objects assigned to a property of a parent object
DomainObjectInterface | $parentObject | The object instance this proxy is part of |
string | $propertyName | The name of the proxied property in it's parent |
mixed | $fieldValue | The raw field value. |
Definition at line 584 of file DataMapper.php.
References DataMapper\getPreparedQuery().
|
protected |
Creates a skeleton of the specified object
string | $className | Name of the class to create a skeleton for |
CannotReconstituteObjectException |
Definition at line 211 of file DataMapper.php.
Referenced by DataMapper\mapSingleRow().
|
protected |
Emits a signal after mapping a single row.
DomainObjectInterface | $object | The mapped object |
Definition at line 199 of file DataMapper.php.
Referenced by DataMapper\mapSingleRow().
fetchRelated | ( | DomainObjectInterface | $parentObject, |
$propertyName, | |||
$fieldValue = '' , |
|||
$enableLazyLoading = true |
|||
) |
Fetches a collection of objects related to a property of a parent object
DomainObjectInterface | $parentObject | The object instance this proxy is part of |
string | $propertyName | The name of the proxied property in it's parent |
mixed | $fieldValue | The raw field value. |
bool | $enableLazyLoading | A flag indication if the related objects should be lazy loaded |
Definition at line 349 of file DataMapper.php.
References DataMapper\fetchRelatedEager().
Referenced by DataMapper\mapObjectToClassProperty(), and DataMapper\thawProperties().
|
protected |
Fetches the related objects from the storage backend.
DomainObjectInterface | $parentObject | The object instance this proxy is part of |
string | $propertyName | The name of the proxied property in it's parent |
mixed | $fieldValue | The raw field value. |
Definition at line 376 of file DataMapper.php.
References DataMapper\getEmptyRelationValue(), and DataMapper\getNonEmptyRelationValue().
Referenced by DataMapper\fetchRelated().
|
protected |
Builds and returns the constraint for multi value properties.
Persistence\QueryInterface | $query | |
DomainObjectInterface | $parentObject | |
string | $propertyName | |
string | $fieldValue | |
array | $relationTableMatchFields |
Definition at line 444 of file DataMapper.php.
References DataMapper\getDataMap(), and GeneralUtility\intExplode().
Referenced by DataMapper\getPreparedQuery().
getDataMap | ( | $className | ) |
Returns a data map for a given class name
string | $className | The class name you want to fetch the Data Map for |
Persistence\Generic\Exception |
Definition at line 611 of file DataMapper.php.
Referenced by DataMapper\convertClassNameToTableName(), DataMapper\convertPropertyNameToColumnName(), DataMapper\getConstraint(), DataMapper\getEmptyRelationValue(), DataMapper\getPreparedQuery(), DataMapper\getSource(), DataMapper\getTargetType(), DataMapper\isPersistableProperty(), DataMapper\propertyMapsByForeignKey(), and DataMapper\thawProperties().
|
protected |
DomainObjectInterface | $parentObject | |
string | $propertyName |
Definition at line 386 of file DataMapper.php.
References DataMapper\getDataMap(), and ColumnMap\RELATION_HAS_ONE.
Referenced by DataMapper\fetchRelatedEager(), and DataMapper\mapObjectToClassProperty().
|
protected |
DomainObjectInterface | $parentObject | |
string | $propertyName | |
string | $fieldValue |
Definition at line 399 of file DataMapper.php.
References DataMapper\getPreparedQuery().
Referenced by DataMapper\fetchRelatedEager().
|
protected |
If the given callback is set the value will be passed on the the callback function. The value will be converted to a string.
string | $value | The string value that should be processed. Will be passed to the callback as first parameter. |
callable | $callback | The data passed to call_user_func(). |
array | $additionalParameters | Optional additional parameters passed to the callback as second argument. |
Definition at line 743 of file DataMapper.php.
Referenced by DataMapper\getPlainValue().
getPlainValue | ( | $input, | |
$columnMap = null , |
|||
$parseStringValueCallback = null , |
|||
array | $parseStringValueCallbackParameters = array() |
||
) |
Returns a plain value, i.e. objects are flattened out if possible. Multi value objects or arrays will be converted to a comma-separated list for use in IN SQL queries.
mixed | $input | The value that will be converted. |
ColumnMap | $columnMap | Optional column map for retrieving the date storage format. |
callable | $parseStringValueCallback | Optional callback method that will be called for string values. Can be used to do database quotation. |
array | $parseStringValueCallbackParameters | Additional parameters that will be passed to the callabck as second parameter. |
\InvalidArgumentException | |
UnexpectedTypeException |
Definition at line 687 of file DataMapper.php.
References elseif, DataMapper\getPlainStringValue(), TypeHandlingUtility\isCoreType(), and TypeHandlingUtility\isValidTypeForMultiValueComparison().
|
protected |
Builds and returns the prepared query, ready to be executed.
DomainObjectInterface | $parentObject | |
string | $propertyName | |
string | $fieldValue |
Definition at line 413 of file DataMapper.php.
References elseif, DataMapper\getConstraint(), DataMapper\getDataMap(), DataMapper\getSource(), DataMapper\getType(), ColumnMap\RELATION_HAS_AND_BELONGS_TO_MANY, and ColumnMap\RELATION_HAS_MANY.
Referenced by DataMapper\countRelated(), and DataMapper\getNonEmptyRelationValue().
|
protected |
Builds and returns the source to build a join for a m:n relation.
DomainObjectInterface | $parentObject | |
string | $propertyName |
Definition at line 473 of file DataMapper.php.
References DataMapper\getDataMap(), DataMapper\getType(), and Query\JCR_JOIN_TYPE_INNER.
Referenced by DataMapper\getPreparedQuery().
getTargetType | ( | $className, | |
array | $row | ||
) |
Returns the target type for the given row.
string | $className | The name of the class |
array | $row | A single array with field_name => value pairs |
Definition at line 156 of file DataMapper.php.
References DataMapper\getDataMap().
Referenced by DataMapper\map().
getType | ( | $parentClassName, | |
$propertyName | |||
) |
Returns the type of a child object.
string | $parentClassName | The class name of the object this proxy is part of |
string | $propertyName | The name of the proxied property in it's parent |
UnexpectedTypeException |
Definition at line 662 of file DataMapper.php.
References elseif.
Referenced by DataMapper\getPreparedQuery(), and DataMapper\getSource().
injectDataMapFactory | ( | \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory | $dataMapFactory | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory | $dataMapFactory |
Definition at line 104 of file DataMapper.php.
References DataMapper\$dataMapFactory.
injectObjectManager | ( | \TYPO3\CMS\Extbase\Object\ObjectManagerInterface | $objectManager | ) |
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface | $objectManager |
Definition at line 120 of file DataMapper.php.
References DataMapper\$objectManager.
injectPersistenceSession | ( | \TYPO3\CMS\Extbase\Persistence\Generic\Session | $persistenceSession | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\Session | $persistenceSession |
Definition at line 96 of file DataMapper.php.
References DataMapper\$persistenceSession.
injectQomFactory | ( | \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory | $qomFactory | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory | $qomFactory |
Definition at line 88 of file DataMapper.php.
References DataMapper\$qomFactory.
injectQueryFactory | ( | \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface | $queryFactory | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface | $queryFactory |
Definition at line 112 of file DataMapper.php.
References DataMapper\$queryFactory.
injectReflectionService | ( | \TYPO3\CMS\Extbase\Reflection\ReflectionService | $reflectionService | ) |
\TYPO3\CMS\Extbase\Reflection\ReflectionService | $reflectionService |
Definition at line 80 of file DataMapper.php.
References DataMapper\$reflectionService.
injectSignalSlotDispatcher | ( | \TYPO3\CMS\Extbase\SignalSlot\Dispatcher | $signalSlotDispatcher | ) |
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher | $signalSlotDispatcher |
Definition at line 128 of file DataMapper.php.
References DataMapper\$signalSlotDispatcher.
isPersistableProperty | ( | $className, | |
$propertyName | |||
) |
Delegates the call to the Data Map. Returns TRUE if the property is persistable (configured in $TCA)
string | $className | The property name |
string | $propertyName | The property name |
Definition at line 598 of file DataMapper.php.
References DataMapper\getDataMap().
map | ( | $className, | |
array | $rows | ||
) |
Maps the given rows on objects
string | $className | The name of the class |
array | $rows | An array of arrays with field_name => value pairs |
Definition at line 140 of file DataMapper.php.
References DataMapper\getTargetType(), and DataMapper\mapSingleRow().
|
protected |
Map value to a core type
string | $type | |
mixed | $value |
Definition at line 310 of file DataMapper.php.
Referenced by DataMapper\thawProperties().
|
protected |
Creates a DateTime from an unix timestamp or date/datetime value. If the input is empty, NULL is returned.
int | string | $value | Unix timestamp or date/datetime value |
NULL | string | $storageFormat | Storage format for native date/datetime fields |
NULL | string | $targetType | The object class name to be created |
Definition at line 324 of file DataMapper.php.
References elseif.
Referenced by DataMapper\thawProperties().
|
protected |
Returns the mapped classProperty from the identiyMap or mapResultToPropertyValue()
If the field value is empty and the column map has no parent key field name, the relation will be empty. If the persistence session has a registered object of the correct type and identity (fieldValue), this function returns that object. Otherwise, it proceeds with mapResultToPropertyValue().
DomainObjectInterface | $parentObject | |
string | $propertyName | |
mixed | $fieldValue | the raw field value |
Definition at line 499 of file DataMapper.php.
References DataMapper\fetchRelated(), DataMapper\getEmptyRelationValue(), DataMapper\mapResultToPropertyValue(), and DataMapper\propertyMapsByForeignKey().
Referenced by DataMapper\thawProperties().
mapResultToPropertyValue | ( | DomainObjectInterface | $parentObject, |
$propertyName, | |||
$result | |||
) |
Returns the given result as property value of the specified property type.
DomainObjectInterface | $parentObject | |
string | $propertyName | |
mixed | $result | The result |
Definition at line 542 of file DataMapper.php.
References elseif.
Referenced by DataMapper\mapObjectToClassProperty(), and DataMapper\thawProperties().
|
protected |
Maps a single row on an object of the given class
string | $className | The name of the target class |
array | $row | A single array with field_name => value pairs |
Definition at line 179 of file DataMapper.php.
References DataMapper\createEmptyObject(), DataMapper\emitAfterMappingSingleRow(), and DataMapper\thawProperties().
Referenced by DataMapper\map().
|
protected |
Checks if the relation is based on a foreign key.
DomainObjectInterface | $parentObject | |
string | $propertyName |
Definition at line 528 of file DataMapper.php.
References DataMapper\getDataMap().
Referenced by DataMapper\mapObjectToClassProperty().
|
protected |
Sets the given properties on the object.
DomainObjectInterface | $object | The object to set properties on |
array | $row |
Definition at line 230 of file DataMapper.php.
References $GLOBALS, DomainObjectInterface\_getProperties(), DomainObjectInterface\_setProperty(), elseif, DataMapper\fetchRelated(), DataMapper\getDataMap(), TypeHandlingUtility\isCoreType(), DataMapper\mapCoreType(), DataMapper\mapDateTime(), DataMapper\mapObjectToClassProperty(), and DataMapper\mapResultToPropertyValue().
Referenced by DataMapper\mapSingleRow().
|
protected |
Definition at line 60 of file DataMapper.php.
Referenced by DataMapper\injectDataMapFactory().
|
protected |
Definition at line 55 of file DataMapper.php.
|
protected |
Definition at line 70 of file DataMapper.php.
Referenced by DataMapper\injectObjectManager().
|
protected |
Definition at line 48 of file DataMapper.php.
|
protected |
Definition at line 41 of file DataMapper.php.
Referenced by DataMapper\injectPersistenceSession().
|
protected |
Definition at line 36 of file DataMapper.php.
Referenced by DataMapper\injectQomFactory().
|
protected |
Definition at line 65 of file DataMapper.php.
Referenced by DataMapper\injectQueryFactory().
|
protected |
Definition at line 31 of file DataMapper.php.
Referenced by DataMapper\injectReflectionService().
|
protected |
Definition at line 75 of file DataMapper.php.
Referenced by DataMapper\injectSignalSlotDispatcher().