Skip to content

Commit 24a2d67

Browse files
committed
bug #1160 Make the paginator use the number of posts defined in the Post entity (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Make the paginator use the number of posts defined in the Post entity Fixes #1159. Commits ------- 6d41061 Make the paginator use the number of posts defined in the Post entity
2 parents 42a22e5 + 6d41061 commit 24a2d67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Pagination/Paginator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace App\Pagination;
1313

14+
use App\Entity\Post;
1415
use Doctrine\ORM\QueryBuilder as DoctrineQueryBuilder;
1516
use Doctrine\ORM\Tools\Pagination\CountWalker;
1617
use Doctrine\ORM\Tools\Pagination\Paginator as DoctrinePaginator;
@@ -20,14 +21,13 @@
2021
*/
2122
class Paginator
2223
{
23-
private const PAGE_SIZE = 10;
2424
private $queryBuilder;
2525
private $currentPage;
2626
private $pageSize;
2727
private $results;
2828
private $numResults;
2929

30-
public function __construct(DoctrineQueryBuilder $queryBuilder, int $pageSize = self::PAGE_SIZE)
30+
public function __construct(DoctrineQueryBuilder $queryBuilder, int $pageSize = Post::NUM_ITEMS)
3131
{
3232
$this->queryBuilder = $queryBuilder;
3333
$this->pageSize = $pageSize;

0 commit comments

Comments
 (0)