Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Pagination/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ class Pagination
protected $pages = 1;
protected $itemsPerPage = 50;

public static function create($query, $page, $items = 50)
public static function create($query, $page, $items = null)
{
return new self($query, $page, $items);
}

public function __construct($query, $page, $itemsPerPage = 50)
public function __construct($query, $page, $itemsPerPage = null)
{
$this->setPage($page);
if ($itemsPerPage === null) $itemsPerPage = 50;
$this->setItemsPerPage($itemsPerPage);

$this->setItems( Paginate::getTotalQueryResults($query) );
Expand Down