Release 2.0.33 (#4273)
* added function to check if meta-field is defined by a plugin * hide un-defined meta-fields in details view * fix default charset = utf8mb4 * remove broken DATABASE_VERSION fallback * split off upgrade infos for version 1.x * fix page out of range #4279
This commit is contained in:
@@ -9,13 +9,23 @@
|
||||
|
||||
namespace App\Utils;
|
||||
|
||||
use App\Repository\Query\BaseQuery;
|
||||
use Pagerfanta\Adapter\AdapterInterface;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
|
||||
final class Pagination extends Pagerfanta
|
||||
{
|
||||
public function __construct(AdapterInterface $adapter)
|
||||
public function __construct(AdapterInterface $adapter, ?BaseQuery $query = null)
|
||||
{
|
||||
parent::__construct($adapter);
|
||||
|
||||
if ($query !== null) {
|
||||
$this->setMaxPerPage($query->getPageSize());
|
||||
$this->setCurrentPage($query->getPage());
|
||||
}
|
||||
|
||||
if ($query === null || !$query->isApiCall()) {
|
||||
$this->setNormalizeOutOfRangePages(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user