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\ConnectionPool
- 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\ExpressionBuilder
- The ExpressionBuilder object is used to
model complex expressions. It is mainly used for
WHERE
andJOIN
conditions. TYPO3\CMS\Core\Database\Query\QueryBuilder
- 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 asRestrictionBuilder
. 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->fetchAssociative()
until the method returnsfalse
.