Release 2.27 (#5212)

This commit is contained in:
Kevin Papst
2024-12-22 22:50:42 +01:00
committed by GitHub
parent 4fdfb6f478
commit 4332ef95a2
56 changed files with 354 additions and 256 deletions

View File

@@ -11,6 +11,7 @@ namespace App\Utils;
use App\Repository\Query\BaseQuery;
use Pagerfanta\Adapter\AdapterInterface;
use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Pagerfanta;
final class Pagination extends Pagerfanta
@@ -19,6 +20,10 @@ final class Pagination extends Pagerfanta
{
parent::__construct($adapter);
if ($adapter instanceof ArrayAdapter && ($size = $adapter->getNbResults()) > 0) {
$this->setMaxPerPage($size);
}
if ($query === null || !$query->isApiCall()) {
$this->setNormalizeOutOfRangePages(true);
}