From ea9bc46e41b8458266ad0065ff1aaa4f107bae0c Mon Sep 17 00:00:00 2001 From: Eric Harrer Date: Wed, 20 Mar 2024 09:51:18 +0100 Subject: [PATCH] [TASK] Use Connection instead of PDO In Doctrine DBAL v4, as described in the documentation, support for using the \PDO::PARAM_* constants has been dropped in favor of the enum types. This should be migrated to Connection::PARAM_* in order to be compatible with TYPO3 v13 later on. Connection::PARAM_* can already be used now as it is compatible with TYPO3 11 and 12. --- Classes/Database/QueryGenerator.php | 3 ++- Classes/Service/GeocodeService.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Classes/Database/QueryGenerator.php b/Classes/Database/QueryGenerator.php index 11c27878..8d1992e0 100644 --- a/Classes/Database/QueryGenerator.php +++ b/Classes/Database/QueryGenerator.php @@ -3,6 +3,7 @@ namespace FriendsOfTYPO3\TtAddress\Database; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -46,7 +47,7 @@ public function getTreeList($id, $depth, $begin = 0): string $queryBuilder->select('uid') ->from('pages') ->where( - $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)), + $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, Connection::PARAM_INT)), $queryBuilder->expr()->eq('sys_language_uid', 0) ) ->orderBy('uid'); diff --git a/Classes/Service/GeocodeService.php b/Classes/Service/GeocodeService.php index 6594e485..ec7b8893 100755 --- a/Classes/Service/GeocodeService.php +++ b/Classes/Service/GeocodeService.php @@ -12,6 +12,7 @@ */ use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryHelper; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; @@ -68,10 +69,10 @@ public function calculateCoordinatesForAllRecordsInTable($addWhereClause = ''): ->where( $queryBuilder->expr()->or( $queryBuilder->expr()->isNull($latitudeField), - $queryBuilder->expr()->eq($latitudeField, $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)), + $queryBuilder->expr()->eq($latitudeField, $queryBuilder->createNamedParameter(0, Connection::PARAM_INT)), $queryBuilder->expr()->eq($latitudeField, 0.00000000000), $queryBuilder->expr()->isNull($longitudeField), - $queryBuilder->expr()->eq($longitudeField, $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)), + $queryBuilder->expr()->eq($longitudeField, $queryBuilder->createNamedParameter(0, Connection::PARAM_INT)), $queryBuilder->expr()->eq($longitudeField, 0.00000000000) ) )