diff --git a/Classes/Domain/Repository/PostRepository.php b/Classes/Domain/Repository/PostRepository.php index 2b24afbc..ca3d7f0f 100644 --- a/Classes/Domain/Repository/PostRepository.php +++ b/Classes/Domain/Repository/PostRepository.php @@ -9,7 +9,7 @@ * LICENSE.txt file that was distributed with this source code. */ -use TYPO3\CMS\Core\Database\Connection; +use Doctrine\DBAL\ParameterType; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Persistence\QueryInterface; @@ -70,7 +70,7 @@ public function findByLocalizedUid(int $uid, bool $respectEnableFields = true): ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT) + $queryBuilder->createNamedParameter($uid, ParameterType::PARAM_INT) ), ) ->setMaxResults(1) diff --git a/Classes/Hooks/Tcemain.php b/Classes/Hooks/Tcemain.php index 43eaab9c..a86b904a 100644 --- a/Classes/Hooks/Tcemain.php +++ b/Classes/Hooks/Tcemain.php @@ -9,6 +9,7 @@ * LICENSE.txt file that was distributed with this source code. */ +use Doctrine\DBAL\ParameterType; use FelixNagel\T3extblog\Domain\Model\Comment; use FelixNagel\T3extblog\Domain\Repository\CommentRepository; use FelixNagel\T3extblog\Service\CommentNotificationService; @@ -192,7 +193,7 @@ protected function getDeleteArrayForTable(int $postId, string $tableName, string ->add(GeneralUtility::makeInstance(DeletedRestriction::class)); $constraints = [ - $queryBuilder->expr()->eq($fieldName, $queryBuilder->createNamedParameter($postId, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq($fieldName, $queryBuilder->createNamedParameter($postId, ParameterType::INTEGER)) ]; if ($tableName === 'tt_content') { @@ -207,7 +208,7 @@ protected function getDeleteArrayForTable(int $postId, string $tableName, string ->from($tableName) ->where(CompositeExpression::and(...$constraints)); - $rows = $queryBuilder->execute()->fetchAll(); + $rows = $queryBuilder->fetchAllAssociative(); foreach ($rows as $record) { $command[$record['uid']]['delete'] = 1; diff --git a/Classes/UpgradeWizard/AbstractSlugUpgradeWizard.php b/Classes/UpgradeWizard/AbstractSlugUpgradeWizard.php index 9eea9cf6..eecacd1e 100644 --- a/Classes/UpgradeWizard/AbstractSlugUpgradeWizard.php +++ b/Classes/UpgradeWizard/AbstractSlugUpgradeWizard.php @@ -9,6 +9,7 @@ * LICENSE.txt file that was distributed with this source code. */ +use Doctrine\DBAL\ParameterType; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\DataHandling\SlugHelper; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -54,7 +55,9 @@ protected function createMissingSlugs( foreach ($rows as $row) { $queryBuilder - ->update($table)->where($constraint, $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT))) + ->update($table)->where($constraint, $queryBuilder->expr()->eq( + 'uid', $queryBuilder->createNamedParameter($row['uid'], ParameterType::INTEGER) + )) ->set($slug, $slugService->generate($row, $row['pid'])) ->executeStatement(); } diff --git a/Classes/UpgradeWizard/CommentAuthorOrEmailValid.php b/Classes/UpgradeWizard/CommentAuthorOrEmailValid.php index 2acb647a..e33306ed 100644 --- a/Classes/UpgradeWizard/CommentAuthorOrEmailValid.php +++ b/Classes/UpgradeWizard/CommentAuthorOrEmailValid.php @@ -39,7 +39,7 @@ protected function findCommentAuthorOrEmailInvalid(): bool ) ); - $rows = $queryBuilder->execute()->fetchAll(); + $rows = $queryBuilder->fetchAllAssociative(); if (count($rows) === 0) { $this->output->writeln('All comment records look valid. Good job!'); diff --git a/Classes/UpgradeWizard/CommentUrlValidation.php b/Classes/UpgradeWizard/CommentUrlValidation.php index 4d5e8203..1d432c2a 100644 --- a/Classes/UpgradeWizard/CommentUrlValidation.php +++ b/Classes/UpgradeWizard/CommentUrlValidation.php @@ -38,7 +38,7 @@ protected function findCommentRecordsForUrlValidation(): bool $queryBuilder->expr()->notLike('website', $queryBuilder->createNamedParameter('https%')) ); - $rows = $queryBuilder->execute()->fetchAll(); + $rows = $queryBuilder->fetchAllAssociative(); if (count($rows) === 0) { $this->output->writeln('All comment URLs look valid. Good job!'); diff --git a/Classes/Utility/BlogPageSearchUtility.php b/Classes/Utility/BlogPageSearchUtility.php index 89ef3eb3..6911c9d0 100644 --- a/Classes/Utility/BlogPageSearchUtility.php +++ b/Classes/Utility/BlogPageSearchUtility.php @@ -9,6 +9,7 @@ * LICENSE.txt file that was distributed with this source code. */ +use Doctrine\DBAL\ParameterType; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -60,10 +61,10 @@ protected static function getBlogModulePages(): array ->from($table) ->where( $queryBuilder->expr()->eq('module', $queryBuilder->createNamedParameter('t3blog')), - $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter(0, ParameterType::INTEGER)) ); - return $queryBuilder->execute()->fetchAll(); + return $queryBuilder->fetchAllAssociative(); } protected static function getPagesWithBlogRecords(string $joinTable): array @@ -85,7 +86,7 @@ protected static function getPagesWithBlogRecords(string $joinTable): array ) ); - return $queryBuilder->execute()->fetchAll(); + return $queryBuilder->fetchAllAssociative(); } /**