From d3cdbc831cdbed0b20b8aa1eb04c3fb4d29fc436 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 18 Oct 2023 19:41:08 +0300 Subject: [PATCH] fix offset/limit --- src/Repository/TorrentRepository.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Repository/TorrentRepository.php b/src/Repository/TorrentRepository.php index 035dc3d..01a10ec 100644 --- a/src/Repository/TorrentRepository.php +++ b/src/Repository/TorrentRepository.php @@ -26,8 +26,8 @@ class TorrentRepository extends ServiceEntityRepository array $locales, ?bool $sensitive = null, ?bool $approved = null, - int $limit = 0, - int $offset = 10 + int $limit = 10, + int $offset = 0 ): int { return $this->getTorrentsQueryByFilter( @@ -45,8 +45,8 @@ class TorrentRepository extends ServiceEntityRepository array $locales, ?bool $sensitive = null, ?bool $approved = null, - int $limit = 0, - int $offset = 10 + int $limit = 10, + int $offset = 0 ): array { return $this->getTorrentsQueryByFilter( @@ -55,10 +55,10 @@ class TorrentRepository extends ServiceEntityRepository $sensitive, $approved, )->setMaxResults($limit) - ->setFirstResult($offset) - ->orderBy('t.id', 'DESC') // same as t.added - ->getQuery() - ->getResult(); + ->setFirstResult($offset) + ->orderBy('t.id', 'DESC') // same as t.added + ->getQuery() + ->getResult(); } private function getTorrentsQueryByFilter(