Skip to content

Commit

Permalink
Merge pull request #233 from web-vision/stefan-2
Browse files Browse the repository at this point in the history
[TASK] Avoid `rowCount()` for select query
  • Loading branch information
calien666 authored May 15, 2023
2 parents 1a76a44 + eea7bb8 commit 643ced1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Classes/Upgrades/GlossaryUpgradeWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,13 @@ public function updateNecessary(): bool
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_wvdeepltranslate_domain_model_glossaries');
$queryBuilder->getRestrictions()->removeAll();
$statement = $queryBuilder
->select('*')
->from('tx_wvdeepltranslate_domain_model_glossaries');
$count = (int)$queryBuilder
->count('*')
->from('tx_wvdeepltranslate_domain_model_glossaries')
->execute()
->fetchColumn(0);

return $statement->execute()->rowCount() > 0;
return $count > 0;
}

/**
Expand Down

0 comments on commit 643ced1

Please sign in to comment.