Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 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 v11 here: TYPO3 ELTS.
Class overview
Doctrine DBAL provides a set of PHP objects to represent, create and handle SQL queries and their results. The basic class structure has been slightly enriched by TYPO3 to add CMS-specific features. Extension authors will usually interact with these classes and objects:
\TYPO3\
CMS\ Core\ Database\ Connection - This object represents a specific connection to
one connected database. It provides "shortcut" methods for simple standard
queries like
SELECT
orUPDATE
. To create more complex queries, an instance of the QueryBuilder can be retrieved. \TYPO3\
CMS\ Core\ Database\ Connection Pool - The ConnectionPool is the main entry point for extensions to retrieve a specific connection over which to execute a query. Usually it is used to return a Connection or a QueryBuilder object.
\TYPO3\
CMS\ Core\ Database\ Query\ Expression\ Expression Builder - The ExpressionBuilder object is used to
model complex expressions. It is mainly used for
WHERE
andJOIN
conditions. \TYPO3\
CMS\ Core\ Database\ Query\ Query Builder - With the help of the QueryBuilder one can
create all sort of complex queries executed on a specific connection. It
provides the main CRUD methods for
select
,() delete
and friends.() TYPO3\
CMS\ Core\ Database\ Query\ Restriction\... - Restrictions are a set of classes that
add expressions like
deleted=0
to a query, based on the TCA settings of a table. They automatically adds TYPO3-specific restrictions like start time and end time, as well as deleted and hidden flags. Further restrictions for language overlays and workspaces are available. In this documentation, these classes are referred asRestriction
.Builder \Doctrine\
DBAL\ Driver\ Statement - This result object is returned when a
SELECT
orCOUNT
query was executed. Single rows are returned as an array by calling->fetch
until the method returnsAssociative () false
.