Typo3DbBackend implements BackendInterface, SingletonInterface
A Storage backend
only to be used within Extbase, not part of TYPO3 Core API.
Table of Contents
Interfaces
- BackendInterface
- Storage backend interface
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $cacheService : CacheService
- $connectionPool : ConnectionPool
- $reflectionService : ReflectionService
Methods
- __construct() : mixed
- addRow() : int
- Adds a row to the storage
- getObjectCountByQuery() : int
- Returns the number of tuples matching the query.
- getObjectDataByQuery() : array<string|int, mixed>
- Returns the object data matching the $query.
- getUidOfAlreadyPersistedValueObject() : int|null
- Checks if a Value Object equal to the given Object exists in the database
- removeRow() : void
- Deletes a row in the storage
- updateRelationTableRow() : void
- Updates a relation row in the storage.
- updateRow() : void
- Updates a row in the storage
- getObjectDataByRawQuery() : array<string|int, mixed>
- Returns the object data using a custom statement
- overlayLanguageAndWorkspace() : array<string|int, mixed>
- Performs workspace and language overlay on the given row array. The language and workspace id is automatically detected (depending on FE or BE context). You can also explicitly set the language/workspace id.
- overlayLanguageAndWorkspaceForJoinedSelect() : array<string|int, mixed>
- If the result consists of a JOIN (usually happens if a property is a relation with a MM table) then it is necessary to only do overlays for the fields that are contained in the main database table, otherwise a SQL error is thrown.
- overlayLanguageAndWorkspaceForSelect() : array<string|int, mixed>
- If the result is a plain SELECT (no JOIN) then the regular overlay process works for tables - overlay workspace - overlay language of versioned record again
- overlayLanguageAndWorkspaceForSingleRecord() : array<string|int, mixed>|int|mixed|null
- Takes one specific row, as defined in TCA and does all overlays.
- resolveMovedRecordsInWorkspace() : array<string|int, mixed>
- Fetches the moved record in case it is supported by the table and if there's only one row in the result set (applying this to all rows does not work, since the sorting order would be destroyed and possible limits are not met anymore) The move pointers are later unset (see versionOL() last argument)
Properties
$cacheService
protected
CacheService
$cacheService
$connectionPool
protected
ConnectionPool
$connectionPool
$reflectionService
protected
ReflectionService
$reflectionService
Methods
__construct()
public
__construct(CacheService $cacheService, ReflectionService $reflectionService) : mixed
Parameters
- $cacheService : CacheService
- $reflectionService : ReflectionService
addRow()
Adds a row to the storage
public
addRow(string $tableName, array<string|int, mixed> $fieldValues[, bool $isRelation = false ]) : int
Parameters
- $tableName : string
-
The database table name
- $fieldValues : array<string|int, mixed>
-
The row to be inserted
- $isRelation : bool = false
-
TRUE if we are currently inserting into a relation table, FALSE by default
Tags
Return values
int —The uid of the inserted row
getObjectCountByQuery()
Returns the number of tuples matching the query.
public
getObjectCountByQuery(QueryInterface $query) : int
Parameters
- $query : QueryInterface
Tags
Return values
int —The number of matching tuples
getObjectDataByQuery()
Returns the object data matching the $query.
public
getObjectDataByQuery(QueryInterface $query) : array<string|int, mixed>
Parameters
- $query : QueryInterface
Tags
Return values
array<string|int, mixed>getUidOfAlreadyPersistedValueObject()
Checks if a Value Object equal to the given Object exists in the database
public
getUidOfAlreadyPersistedValueObject(AbstractValueObject $object) : int|null
Parameters
- $object : AbstractValueObject
-
The Value Object
Tags
Return values
int|null —The matching uid if an object was found, else FALSE
removeRow()
Deletes a row in the storage
public
removeRow(string $tableName, array<string|int, mixed> $where[, bool $isRelation = false ]) : void
Parameters
- $tableName : string
-
The database table name
- $where : array<string|int, mixed>
-
An array of where array('fieldname' => value).
- $isRelation : bool = false
-
TRUE if we are currently manipulating a relation table, FALSE by default
Tags
updateRelationTableRow()
Updates a relation row in the storage.
public
updateRelationTableRow(string $tableName, array<string|int, mixed> $fieldValues) : void
Parameters
- $tableName : string
-
The database relation table name
- $fieldValues : array<string|int, mixed>
-
The row to be updated
Tags
updateRow()
Updates a row in the storage
public
updateRow(string $tableName, array<string|int, mixed> $fieldValues[, bool $isRelation = false ]) : void
Parameters
- $tableName : string
-
The database table name
- $fieldValues : array<string|int, mixed>
-
The row to be updated
- $isRelation : bool = false
-
TRUE if we are currently inserting into a relation table, FALSE by default
Tags
getObjectDataByRawQuery()
Returns the object data using a custom statement
protected
getObjectDataByRawQuery(Statement $statement) : array<string|int, mixed>
Parameters
- $statement : Statement
Tags
Return values
array<string|int, mixed>overlayLanguageAndWorkspace()
Performs workspace and language overlay on the given row array. The language and workspace id is automatically detected (depending on FE or BE context). You can also explicitly set the language/workspace id.
protected
overlayLanguageAndWorkspace(SourceInterface $source, array<string|int, mixed> $rows, QueryInterface $query[, int|null $workspaceUid = null ]) : array<string|int, mixed>
Parameters
- $source : SourceInterface
-
The source (selector or join)
- $rows : array<string|int, mixed>
- $query : QueryInterface
- $workspaceUid : int|null = null
Tags
Return values
array<string|int, mixed>overlayLanguageAndWorkspaceForJoinedSelect()
If the result consists of a JOIN (usually happens if a property is a relation with a MM table) then it is necessary to only do overlays for the fields that are contained in the main database table, otherwise a SQL error is thrown.
protected
overlayLanguageAndWorkspaceForJoinedSelect(string $tableName, array<string|int, mixed> $rows, PageRepository $pageRepository, QueryInterface $query) : array<string|int, mixed>
In order to make this happen, a single SQL query is made to fetch all possible field names (= array keys) of a record (TCA[$tableName][columns] does not contain all needed information), which is then used to compute a separate subset of the row which can be overlaid properly.
Parameters
- $tableName : string
- $rows : array<string|int, mixed>
- $pageRepository : PageRepository
- $query : QueryInterface
Return values
array<string|int, mixed>overlayLanguageAndWorkspaceForSelect()
If the result is a plain SELECT (no JOIN) then the regular overlay process works for tables - overlay workspace - overlay language of versioned record again
protected
overlayLanguageAndWorkspaceForSelect(string $tableName, array<string|int, mixed> $rows, PageRepository $pageRepository, QueryInterface $query) : array<string|int, mixed>
Parameters
- $tableName : string
- $rows : array<string|int, mixed>
- $pageRepository : PageRepository
- $query : QueryInterface
Return values
array<string|int, mixed>overlayLanguageAndWorkspaceForSingleRecord()
Takes one specific row, as defined in TCA and does all overlays.
protected
overlayLanguageAndWorkspaceForSingleRecord(string $tableName, array<string|int, mixed> $row, PageRepository $pageRepository, QueryInterface $query) : array<string|int, mixed>|int|mixed|null
Parameters
- $tableName : string
- $row : array<string|int, mixed>
- $pageRepository : PageRepository
- $query : QueryInterface
Return values
array<string|int, mixed>|int|mixed|null —the overlaid row or false or null if overlay failed.
resolveMovedRecordsInWorkspace()
Fetches the moved record in case it is supported by the table and if there's only one row in the result set (applying this to all rows does not work, since the sorting order would be destroyed and possible limits are not met anymore) The move pointers are later unset (see versionOL() last argument)
protected
resolveMovedRecordsInWorkspace(string $tableName, array<string|int, mixed> $rows, int $workspaceUid) : array<string|int, mixed>
Parameters
- $tableName : string
- $rows : array<string|int, mixed>
- $workspaceUid : int