Attention
TYPO3 v10 has reached end-of-life as of April 30th 2023 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
Class Overview¶
Doctrine provides a set of php
objects to represent, create and handle SQL queries and
their results. The basic class structure was slightly enriched by TYPO3 to add CMS
specific features. Extension authors will typically interact with these classes and objects:
- Connection
TYPO3\CMS\Core\Database\Connection
: Object representing a specific connection to one connected database. Provides "shortcut" methods for simple standard queries likeSELECT
orUPDATE
. An instance of the QueryBuilder can be retrieved to build more complex queries.- ConnectionPool
TYPO3\CMS\Core\Database\ConnectionPool
: Main entry point for extensions to retrieve a specific connection a query should be executed on. Typically used to return a Connection or a QueryBuilder object.- ExpressionBuilder
TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
: Object to model complex expressions. Mainly used forWHERE
andJOIN
conditions.- QueryBuilder
TYPO3\CMS\Core\Database\Query\QueryBuilder
: Object to create all sort of complex queries executed on a specific connection. Provides the mainCRUD
methods forselect()
,delete()
and friends.- QueryHelper
TYPO3\CMS\Core\Database\Query\QueryHelper
: Set of static helper methods that can simplify the transition from oldTYPO3_DB
based code to the doctrine base API.- Restriction ...
TYPO3\CMS\Core\Database\Query\Restriction\...
: Set of classes that add expressions like "deleted=0" to a query based onTCA
settings of a table. This automatically adds TYPO3 specific restrictions like starttime and endtime, as well as deleted and hidden flags. Further restrictions for language overlays and workspaces are available. This documentation refers to these classes as theRestrictionBuilder
.- Statement
Doctrine\DBAL\Driver\Statement
: Result object retrieved if aSELECT
orCOUNT
query has been executed. Single rows are returned as array by calling->fetch()
until the method returnsfalse
.