[TASK] Deprecate DatabaseConnection based prepared statements in Extbase 77/50177/5
authorBenni Mack <benni@typo3.org>
Mon, 10 Oct 2016 19:16:04 +0000 (21:16 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 31 Dec 2016 14:09:37 +0000 (15:09 +0100)
Extbase has a way to set raw statements with PreparedStatements
based on DatabaseConnection. This functionality has been marked
as deprecated as Doctrine DBAL shows a superior way of doing
so natively within the database directly.

Resolves: #78225
Releases: master
Change-Id: I915526fa27e53c92fa9d017be8b6e555fcfe944e
Reviewed-on: https://review.typo3.org/50177
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-78225-LegacyPreparedStatementsWithinExtbase.rst [new file with mode: 0644]

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-78225-LegacyPreparedStatementsWithinExtbase.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-78225-LegacyPreparedStatementsWithinExtbase.rst
new file mode 100644 (file)
index 0000000..8e73815
--- /dev/null
@@ -0,0 +1,34 @@
+.. include:: ../../Includes.txt
+Deprecation: #78225 - Legacy PreparedStatements within Extbase
+See :issue:`78225`
+Extbase has a way to set raw statements with PreparedStatements based on the legacy DatabaseConnection a.k.a. ``TYPO3_DB``.
+This functionality has been marked as deprecated.
+Calling a query within Extbase with ``$query->setStatement($preparedStatement)`` using a
+``\TYPO3\CMS\Core\Database\PreparedStatement`` object will trigger a deprecation log entry.
+Affected Installations
+Any TYPO3 extension with Extbase functionality using custom prepared statements with the legacy database API.
+Use the same method ``setStatement()`` and provide a QueryBuilder object or a Statement object based on Doctrine DBAL.
+.. index:: Database, PHP-API
index f1dc838..4eec01c 100644 (file)
@@ -379,6 +379,7 @@ class Typo3DbBackend implements BackendInterface, SingletonInterface
             $rows = $result->fetchAll();
         } elseif ($realStatement instanceof \TYPO3\CMS\Core\Database\PreparedStatement) {
+            GeneralUtility::deprecationLog('Extbase support for Prepared Statements has been deprecated in TYPO3 v8, and will be removed in TYPO3 v9. Use native Doctrine DBAL Statements or QueryBuilder objects.');
             $rows = $realStatement->fetchAll();