TYPO3
7.6
|
Protected Member Functions | |
resolveWhereStatement (array $where, $tableName= 'foo') | |
createQueryCommandParametersFromStatementParts (array $statementParts) | |
getRowsByStatementParts (QueryInterface $query) | |
getRowsFromDatabase (array $statementParts) | |
getRowsFromPreparedDatabase (array $statementParts, array $parameters) | |
getObjectDataByRawQuery (Qom\Statement $statement) | |
getStatementParts ($query, $resolveParameterPlaceholders=true) | |
resolveParameterPlaceholders (array $statementParts, array $parameters) | |
replacePlaceholders (&$sqlString, array $parameters, $tableName= 'foo') | |
addVisibilityConstraintStatement (\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings, $tableName, array &$sql) | |
getFrontendConstraintStatement ($tableName, $ignoreEnableFields, array $enableFieldsToBeIgnored=array(), $includeDeleted) | |
getBackendConstraintStatement ($tableName, $ignoreEnableFields, $includeDeleted) | |
doLanguageAndWorkspaceOverlay (Qom\SourceInterface $source, array $rows,\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings, $workspaceUid=null) | |
getPageRepository () | |
checkSqlErrors ($sql= '') | |
clearPageCache ($tableName, $uid) | |
getQueryCacheEntry ($entryIdentifier) | |
setQueryCacheEntry ($entryIdentifier, $variable) | |
Protected Attributes | |
$databaseHandle | |
$dataMapper | |
$pageRepository | |
$pageTSConfigCache = array() | |
$configurationManager | |
$cacheService | |
$cacheManager | |
$tableColumnCache | |
$queryCache | |
$environmentService | |
$queryParser | |
$queryRuntimeCache = array() | |
A Storage backend
Definition at line 24 of file Typo3DbBackend.php.
__construct | ( | ) |
Constructor. takes the database handle from $GLOBALS['TYPO3_DB']
Definition at line 145 of file Typo3DbBackend.php.
References $GLOBALS.
addRow | ( | $tableName, | |
array | $fieldValues, | ||
$isRelation = false |
|||
) |
Adds a row to the storage
string | $tableName | The database table name |
array | $fieldValues | The row to be inserted |
bool | $isRelation | TRUE if we are currently inserting into a relation table, FALSE by default |
Implements BackendInterface.
Definition at line 169 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\clearPageCache().
|
protected |
Adds enableFields and deletedClause to the query if necessary
\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface | $querySettings | |
string | $tableName | The database table name |
array | &$sql | The query parts |
Definition at line 689 of file Typo3DbBackend.php.
References $GLOBALS, Typo3DbBackend\getBackendConstraintStatement(), and Typo3DbBackend\getFrontendConstraintStatement().
Referenced by Typo3DbBackend\getUidOfAlreadyPersistedValueObject().
|
protected |
Checks if there are SQL errors in the last query, and if yes, throw an exception.
string | $sql | The SQL statement |
\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException |
Definition at line 873 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\addRow(), Typo3DbBackend\getMaxValueFromTable(), Typo3DbBackend\getObjectCountByQuery(), Typo3DbBackend\getObjectDataByRawQuery(), Typo3DbBackend\getRowByIdentifier(), Typo3DbBackend\getRowsFromDatabase(), Typo3DbBackend\getUidOfAlreadyPersistedValueObject(), Typo3DbBackend\removeRow(), Typo3DbBackend\updateRelationTableRow(), and Typo3DbBackend\updateRow().
|
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.
string | $tableName | Table name of the record |
int | $uid | UID of the record |
Definition at line 893 of file Typo3DbBackend.php.
References $GLOBALS, elseif, and BackendUtility\getPagesTSconfig().
Referenced by Typo3DbBackend\addRow(), Typo3DbBackend\removeRow(), and Typo3DbBackend\updateRow().
|
protected |
Creates the parameters for the query methods of the database methods in the TYPO3 core, from an array that came from a parsed query.
array | $statementParts |
Definition at line 363 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\getObjectCountByQuery(), Typo3DbBackend\getRowsFromDatabase(), and Typo3DbBackend\getRowsFromPreparedDatabase().
|
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.
Qom\SourceInterface | $source | The source (selector od join) |
array | $rows | |
\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface | $querySettings | The TYPO3 CMS specific query settings |
null | int | $workspaceUid |
Definition at line 769 of file Typo3DbBackend.php.
References $GLOBALS, Typo3DbBackend\$pageRepository, elseif, Typo3DbBackend\getPageRepository(), and BackendUtility\isTableWorkspaceEnabled().
Referenced by Typo3DbBackend\getObjectDataByQuery().
|
protected |
Returns constraint statement for backend context
string | $tableName | |
bool | $ignoreEnableFields | A flag indicating whether the enable fields should be ignored |
bool | $includeDeleted | A flag indicating whether deleted records should be included |
Definition at line 747 of file Typo3DbBackend.php.
References BackendUtility\BEenableFields(), and BackendUtility\deleteClause().
Referenced by Typo3DbBackend\addVisibilityConstraintStatement().
|
protected |
Returns constraint statement for frontend context
string | $tableName | |
bool | $ignoreEnableFields | A flag indicating whether the enable fields should be ignored |
array | $enableFieldsToBeIgnored | If $ignoreEnableFields is true, this array specifies enable fields to be ignored. If it is NULL or an empty array (default) all enable fields are ignored. |
bool | $includeDeleted | A flag indicating whether deleted records should be included |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception\InconsistentQuerySettingsException |
Definition at line 720 of file Typo3DbBackend.php.
References elseif, and Typo3DbBackend\getPageRepository().
Referenced by Typo3DbBackend\addVisibilityConstraintStatement().
getMaxValueFromTable | ( | $tableName, | |
array | $where, | ||
$columnName | |||
) |
Fetches maximal value for given table column from database.
string | $tableName | The database table name |
array | $where | An array of where array('fieldname' => value). |
string | $columnName | column name to get the max value from |
Implements BackendInterface.
Definition at line 284 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\resolveWhereStatement().
getObjectCountByQuery | ( | QueryInterface | $query | ) |
Returns the number of tuples matching the query.
QueryInterface | $query |
Exception\BadConstraintException |
Definition at line 485 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), Typo3DbBackend\createQueryCommandParametersFromStatementParts(), QueryInterface\getConstraint(), and Typo3DbBackend\getStatementParts().
getObjectDataByQuery | ( | QueryInterface | $query | ) |
Returns the object data matching the $query.
QueryInterface | $query |
Definition at line 343 of file Typo3DbBackend.php.
References Typo3DbBackend\doLanguageAndWorkspaceOverlay(), Typo3DbBackend\getObjectDataByRawQuery(), QueryInterface\getQuerySettings(), Typo3DbBackend\getRowsByStatementParts(), QueryInterface\getSource(), and QueryInterface\getStatement().
|
protected |
Returns the object data using a custom statement
Qom\Statement | $statement |
Definition at line 452 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors().
Referenced by Typo3DbBackend\getObjectDataByQuery().
|
protected |
Definition at line 853 of file Typo3DbBackend.php.
References $GLOBALS, and Typo3DbBackend\$pageRepository.
Referenced by Typo3DbBackend\doLanguageAndWorkspaceOverlay(), and Typo3DbBackend\getFrontendConstraintStatement().
|
protected |
Finds and returns a variable value from the query cache.
string | $entryIdentifier | Identifier of the cache entry to fetch |
Definition at line 942 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\getStatementParts().
getRowByIdentifier | ( | $tableName, | |
array | $where | ||
) |
Fetches row data from the database
string | $tableName | |
array | $where | An array of where array('fieldname' => value). |
Definition at line 306 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\resolveWhereStatement().
|
protected |
Determines whether to use prepared statement or not and returns the rows from the corresponding method
QueryInterface | $query |
Definition at line 385 of file Typo3DbBackend.php.
References QueryInterface\getQuerySettings(), Typo3DbBackend\getRowsFromDatabase(), Typo3DbBackend\getRowsFromPreparedDatabase(), and Typo3DbBackend\getStatementParts().
Referenced by Typo3DbBackend\getObjectDataByQuery().
|
protected |
Fetches the rows directly from the database, not using prepared statement
array | $statementParts |
Definition at line 404 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\createQueryCommandParametersFromStatementParts().
Referenced by Typo3DbBackend\getRowsByStatementParts().
|
protected |
Fetches the rows from the database, using prepared statement
array | $statementParts | |
array | $parameters |
Definition at line 427 of file Typo3DbBackend.php.
References Typo3DbBackend\createQueryCommandParametersFromStatementParts().
Referenced by Typo3DbBackend\getRowsByStatementParts().
|
protected |
Looks for the query in cache or builds it up otherwise
QueryInterface | $query | |
bool | $resolveParameterPlaceholders | whether to resolve the parameters or leave the placeholders |
\RuntimeException |
The queryParser will preparse the query to get the query's hash and parameters. If the hash is found in the cache and useQueryCaching is enabled, extbase will then take the string representation from cache and build a prepared query with the parameters found.
Otherwise extbase will parse the complete query, build the string representation and run a usual query.
Definition at line 525 of file Typo3DbBackend.php.
References Typo3DbBackend\getQueryCacheEntry(), Typo3DbBackend\resolveParameterPlaceholders(), and Typo3DbBackend\setQueryCacheEntry().
Referenced by Typo3DbBackend\getObjectCountByQuery(), and Typo3DbBackend\getRowsByStatementParts().
getUidOfAlreadyPersistedValueObject | ( | \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject | $object | ) |
Checks if a Value Object equal to the given Object exists in the data base
\TYPO3\CMS\Extbase\DomainObject\AbstractValueObject | $object | The Value Object |
Implements BackendInterface.
Definition at line 603 of file Typo3DbBackend.php.
References Typo3DbBackend\addVisibilityConstraintStatement(), Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\replacePlaceholders().
initializeObject | ( | ) |
injectCacheManager | ( | \TYPO3\CMS\Core\Cache\CacheManager | $cacheManager | ) |
\TYPO3\CMS\Core\Cache\CacheManager | $cacheManager |
Definition at line 121 of file Typo3DbBackend.php.
References Typo3DbBackend\$cacheManager.
injectCacheService | ( | \TYPO3\CMS\Extbase\Service\CacheService | $cacheService | ) |
\TYPO3\CMS\Extbase\Service\CacheService | $cacheService |
Definition at line 113 of file Typo3DbBackend.php.
References Typo3DbBackend\$cacheService.
injectConfigurationManager | ( | \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface | $configurationManager | ) |
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface | $configurationManager |
Definition at line 105 of file Typo3DbBackend.php.
References Typo3DbBackend\$configurationManager.
injectDataMapper | ( | \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper | $dataMapper | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper | $dataMapper |
Definition at line 97 of file Typo3DbBackend.php.
References Typo3DbBackend\$dataMapper.
injectEnvironmentService | ( | \TYPO3\CMS\Extbase\Service\EnvironmentService | $environmentService | ) |
\TYPO3\CMS\Extbase\Service\EnvironmentService | $environmentService |
Definition at line 129 of file Typo3DbBackend.php.
References Typo3DbBackend\$environmentService.
injectQueryParser | ( | \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser | $queryParser | ) |
\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser | $queryParser |
Definition at line 137 of file Typo3DbBackend.php.
References Typo3DbBackend\$queryParser.
quoteTextValueCallback | ( | $value, | |
$parameters | |||
) |
Will be called by the data mapper to quote string values.
string | $value | The value to be quoted. |
array | $parameters | Additional parameters array currently containing the "tablename" key. |
Definition at line 591 of file Typo3DbBackend.php.
removeRow | ( | $tableName, | |
array | $where, | ||
$isRelation = false |
|||
) |
Deletes a row in the storage
string | $tableName | The database table name |
array | $where | An array of where array('fieldname' => value). |
bool | $isRelation | TRUE if we are currently manipulating a relation table, FALSE by default |
Implements BackendInterface.
Definition at line 261 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), Typo3DbBackend\clearPageCache(), and Typo3DbBackend\resolveWhereStatement().
|
protected |
Replace query placeholders in a query part by the given parameters.
string | &$sqlString | The query part with placeholders |
array | $parameters | The parameters |
string | $tableName |
\TYPO3\CMS\Extbase\Persistence\Generic\Exception |
Definition at line 653 of file Typo3DbBackend.php.
References elseif.
Referenced by Typo3DbBackend\getUidOfAlreadyPersistedValueObject().
|
protected |
Replaces the parameters in the queryStructure with given values
array | $statementParts | |
array | $parameters |
Definition at line 572 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\getStatementParts().
|
protected |
Converts an array to an AND concatenated where statement
array | $where | array('fieldName' => 'fieldValue') |
string | $tableName | table to use for escaping config |
Definition at line 326 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\getMaxValueFromTable(), Typo3DbBackend\getRowByIdentifier(), Typo3DbBackend\removeRow(), and Typo3DbBackend\updateRelationTableRow().
|
protected |
Saves the value of a PHP variable in the query cache.
string | $entryIdentifier | An identifier used for this cache entry |
mixed | $variable | The query to cache |
Definition at line 957 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\getStatementParts().
updateRelationTableRow | ( | $tableName, | |
array | $fieldValues | ||
) |
Updates a relation row in the storage.
string | $tableName | The database relation table name |
array | $fieldValues | The row to be updated |
\InvalidArgumentException |
Implements BackendInterface.
Definition at line 221 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\resolveWhereStatement().
updateRow | ( | $tableName, | |
array | $fieldValues, | ||
$isRelation = false |
|||
) |
Updates a row in the storage
string | $tableName | The database table name |
array | $fieldValues | The row to be updated |
bool | $isRelation | TRUE if we are currently inserting into a relation table, FALSE by default |
\InvalidArgumentException |
Implements BackendInterface.
Definition at line 194 of file Typo3DbBackend.php.
References Typo3DbBackend\checkSqlErrors(), and Typo3DbBackend\clearPageCache().
|
protected |
Definition at line 65 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\injectCacheManager().
|
protected |
Definition at line 60 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\injectCacheService().
|
protected |
Definition at line 55 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\injectConfigurationManager().
|
protected |
Definition at line 31 of file Typo3DbBackend.php.
|
protected |
Definition at line 36 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\injectDataMapper().
|
protected |
Definition at line 80 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\injectEnvironmentService().
|
protected |
Definition at line 43 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\doLanguageAndWorkspaceOverlay(), and Typo3DbBackend\getPageRepository().
|
protected |
Definition at line 50 of file Typo3DbBackend.php.
|
protected |
Definition at line 75 of file Typo3DbBackend.php.
|
protected |
Definition at line 85 of file Typo3DbBackend.php.
Referenced by Typo3DbBackend\injectQueryParser().
|
protected |
Definition at line 92 of file Typo3DbBackend.php.
|
protected |
Definition at line 70 of file Typo3DbBackend.php.