From 8e169652beaf8849475039c3d29f9674b8cb717e Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Fri, 16 Feb 2024 11:19:01 +0100 Subject: [PATCH] [TASK] Reduce pagebrowser items in company list view by setting a limit of 750 companies. This is the same amount as for lead list. --- Classes/Domain/Repository/CompanyRepository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Domain/Repository/CompanyRepository.php b/Classes/Domain/Repository/CompanyRepository.php index 0ef9115d..d2806b02 100644 --- a/Classes/Domain/Repository/CompanyRepository.php +++ b/Classes/Domain/Repository/CompanyRepository.php @@ -3,7 +3,6 @@ declare(strict_types=1); namespace In2code\Lux\Domain\Repository; -use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; use Doctrine\DBAL\Exception as ExceptionDbal; use Exception; use In2code\Lux\Domain\Model\Company; @@ -24,11 +23,11 @@ class CompanyRepository extends AbstractRepository /** * @param FilterDto $filter + * @param int $limit * @return array * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ - public function findByFilter(FilterDto $filter): array + public function findByFilter(FilterDto $filter, int $limit = 750): array { $sql = 'select c.uid,sum(v.scoring) companyscoring' . ' from ' . Company::TABLE_NAME . ' c' @@ -42,6 +41,7 @@ public function findByFilter(FilterDto $filter): array $sql .= ' group by c.uid'; $sql .= $this->extendWhereClauseWithFilterCompanyscoring($filter); $sql .= ' order by companyscoring desc'; + $sql .= ' limit ' . $limit; $connection = DatabaseUtility::getConnectionForTable(Company::TABLE_NAME); $results = $connection->executeQuery($sql)->fetchAllKeyValue();