TYPO3 CMS  TYPO3_8-7
TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend:
TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 injectDataMapper (DataMapper $dataMapper)
 
 injectConfigurationManager (ConfigurationManagerInterface $configurationManager)
 
 injectCacheService (CacheService $cacheService)
 
 injectEnvironmentService (EnvironmentService $environmentService)
 
 injectObjectManager (ObjectManagerInterface $objectManager)
 
 __construct ()
 
 addRow ($tableName, array $fieldValues, $isRelation=false)
 
 updateRow ($tableName, array $fieldValues, $isRelation=false)
 
 updateRelationTableRow ($tableName, array $fieldValues)
 
 removeRow ($tableName, array $where, $isRelation=false)
 
 getMaxValueFromTable ($tableName, array $where, $columnName)
 
 getRowByIdentifier ($tableName, array $where)
 
 getObjectDataByQuery (QueryInterface $query)
 
 getObjectCountByQuery (QueryInterface $query)
 
 getUidOfAlreadyPersistedValueObject (AbstractValueObject $object)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface
 getObjectCountByQuery (\TYPO3\CMS\Extbase\Persistence\QueryInterface $query)
 
 getObjectDataByQuery (\TYPO3\CMS\Extbase\Persistence\QueryInterface $query)
 
 getUidOfAlreadyPersistedValueObject (\TYPO3\CMS\Extbase\DomainObject\AbstractValueObject $object)
 

Protected Member Functions

 getObjectDataByRawQuery (Qom\Statement $statement)
 
 doLanguageAndWorkspaceOverlay (Qom\SourceInterface $source, array $rows, QuerySettingsInterface $querySettings, $workspaceUid=null)
 
 getPageRepository ()
 
 clearPageCache ($tableName, $uid)
 
 getTSFE ()
 
 getBeUser ()
 

Protected Attributes

 $connectionPool
 
 $dataMapper
 
 $pageRepository
 
 $configurationManager
 
 $cacheService
 
 $environmentService
 
 $objectManager
 
 $hasPidColumn = []
 

Detailed Description

A Storage backend

Definition at line 45 of file Typo3DbBackend.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::__construct ( )

Constructor. takes the database handle from $GLOBALS['TYPO3_DB']

Definition at line 135 of file Typo3DbBackend.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ addRow()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::addRow (   $tableName,
array  $fieldValues,
  $isRelation = false 
)

Adds a row to the storage

Parameters
string$tableNameThe database table name
array$fieldValuesThe row to be inserted
bool$isRelationTRUE if we are currently inserting into a relation table, FALSE by default
Returns
int The uid of the inserted row
Exceptions
SqlErrorException

Implements TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface.

Definition at line 149 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\clearPageCache().

◆ clearPageCache()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::clearPageCache (   $tableName,
  $uid 
)
protected

Clear the TYPO3 page cache for the given record. If the record lies on a page, then we clear the cache of this page. If the record has no PID column, we clear the cache of the current page as best-effort.

Much of this functionality is taken from DataHandler::clear_cache() which unfortunately only works with logged-in BE user.

Parameters
string$tableNameTable name of the record
int$uidUID of the record

Definition at line 689 of file Typo3DbBackend.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK, TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getTSFE(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\addRow(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\removeRow(), and TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\updateRow().

◆ doLanguageAndWorkspaceOverlay()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::doLanguageAndWorkspaceOverlay ( Qom\SourceInterface  $source,
array  $rows,
QuerySettingsInterface  $querySettings,
  $workspaceUid = null 
)
protected

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.

Parameters
Qom\SourceInterface$sourceThe source (selector od join)
array$rows
QuerySettingsInterface$querySettingsThe TYPO3 CMS specific query settings
int | null$workspaceUid
Returns
array

Definition at line 561 of file Typo3DbBackend.php.

References $GLOBALS, TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$pageRepository, TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getBeUser(), TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface\getLanguageMode(), TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface\getLanguageUid(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getPageRepository(), TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getTSFE(), and TYPO3\CMS\Backend\Utility\BackendUtility\isTableWorkspaceEnabled().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getObjectDataByQuery().

◆ getBeUser()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getBeUser ( )
protected
Returns
BackendUserAuthentication|null

Definition at line 763 of file Typo3DbBackend.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\doLanguageAndWorkspaceOverlay().

◆ getMaxValueFromTable()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getMaxValueFromTable (   $tableName,
array  $where,
  $columnName 
)

Fetches maximal value for given table column from database.

Parameters
string$tableNameThe database table name
array$whereAn array of where array('fieldname' => value).
string$columnNamecolumn name to get the max value from
Returns
mixed the max value
Exceptions
SqlErrorException

Implements TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface.

Definition at line 302 of file Typo3DbBackend.php.

◆ getObjectCountByQuery()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getObjectCountByQuery ( QueryInterface  $query)

◆ getObjectDataByQuery()

◆ getObjectDataByRawQuery()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getObjectDataByRawQuery ( Qom\Statement  $statement)
protected

Returns the object data using a custom statement

Parameters
Qom\Statement$statement
Returns
array
Exceptions
SqlErrorExceptionwhen the raw SQL statement fails in the database

Definition at line 408 of file Typo3DbBackend.php.

References TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME, and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

Referenced by TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getObjectDataByQuery().

◆ getPageRepository()

◆ getRowByIdentifier()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getRowByIdentifier (   $tableName,
array  $where 
)

Fetches row data from the database

Parameters
string$tableName
array$whereAn array of where array('fieldname' => value).
Returns
array|bool
Exceptions
SqlErrorException

Definition at line 334 of file Typo3DbBackend.php.

◆ getTSFE()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getTSFE ( )
protected

◆ getUidOfAlreadyPersistedValueObject()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::getUidOfAlreadyPersistedValueObject ( AbstractValueObject  $object)

Checks if a Value Object equal to the given Object exists in the database

Parameters
AbstractValueObject$objectThe Value Object
Returns
mixed The matching uid if an object was found, else FALSE
Exceptions
SqlErrorException

Definition at line 511 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_getProperties(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ injectCacheService()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::injectCacheService ( CacheService  $cacheService)
Parameters
CacheService$cacheService

Definition at line 111 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$cacheService.

◆ injectConfigurationManager()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::injectConfigurationManager ( ConfigurationManagerInterface  $configurationManager)
Parameters
ConfigurationManagerInterface$configurationManager

Definition at line 103 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$configurationManager.

◆ injectDataMapper()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::injectDataMapper ( DataMapper  $dataMapper)
Parameters
DataMapper$dataMapper

Definition at line 95 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$dataMapper.

◆ injectEnvironmentService()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::injectEnvironmentService ( EnvironmentService  $environmentService)
Parameters
EnvironmentService$environmentService

Definition at line 119 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$environmentService.

◆ injectObjectManager()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::injectObjectManager ( ObjectManagerInterface  $objectManager)
Parameters
ObjectManagerInterface$objectManager

Definition at line 127 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$objectManager.

◆ removeRow()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::removeRow (   $tableName,
array  $where,
  $isRelation = false 
)

Deletes a row in the storage

Parameters
string$tableNameThe database table name
array$whereAn array of where array('fieldname' => value).
bool$isRelationTRUE if we are currently manipulating a relation table, FALSE by default
Returns
bool
Exceptions
SqlErrorException

Implements TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface.

Definition at line 277 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\clearPageCache().

◆ updateRelationTableRow()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::updateRelationTableRow (   $tableName,
array  $fieldValues 
)

Updates a relation row in the storage.

Parameters
string$tableNameThe database relation table name
array$fieldValuesThe row to be updated
Returns
bool
Exceptions
SqlErrorException

Implements TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface.

Definition at line 235 of file Typo3DbBackend.php.

◆ updateRow()

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::updateRow (   $tableName,
array  $fieldValues,
  $isRelation = false 
)

Updates a row in the storage

Parameters
string$tableNameThe database table name
array$fieldValuesThe row to be updated
bool$isRelationTRUE if we are currently inserting into a relation table, FALSE by default
Returns
bool
Exceptions

Implements TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface.

Definition at line 191 of file Typo3DbBackend.php.

References TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\clearPageCache().

Member Data Documentation

◆ $cacheService

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$cacheService
protected

◆ $configurationManager

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$configurationManager
protected

◆ $connectionPool

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$connectionPool
protected

Definition at line 50 of file Typo3DbBackend.php.

◆ $dataMapper

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$dataMapper
protected

◆ $environmentService

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$environmentService
protected

◆ $hasPidColumn

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$hasPidColumn = []
protected

Definition at line 90 of file Typo3DbBackend.php.

◆ $objectManager

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$objectManager
protected

◆ $pageRepository

TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::$pageRepository
protected