Release 2.27 (#5212)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user