Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions Classes/Hooks/Tcemain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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') {
Expand All @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion Classes/UpgradeWizard/AbstractSlugUpgradeWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/UpgradeWizard/CommentAuthorOrEmailValid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down
2 changes: 1 addition & 1 deletion Classes/UpgradeWizard/CommentUrlValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down
7 changes: 4 additions & 3 deletions Classes/Utility/BlogPageSearchUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -85,7 +86,7 @@ protected static function getPagesWithBlogRecords(string $joinTable): array
)
);

return $queryBuilder->execute()->fetchAll();
return $queryBuilder->fetchAllAssociative();
}

/**
Expand Down

0 comments on commit c84978a

Please sign in to comment.