Skip to content

Commit

Permalink
[TASK] Use Connection instead of PDO (#520)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ErHaWeb authored Mar 20, 2024
1 parent 197c2fc commit 0ae85fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Classes/Database/QueryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down
5 changes: 3 additions & 2 deletions Classes/Service/GeocodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
)
)
Expand Down

0 comments on commit 0ae85fb

Please sign in to comment.