fix pagination comment.
This commit is contained in:
parent
cd17761f72
commit
bbae90adad
|
@ -655,19 +655,19 @@ public function aggregate($aggregator, $columns)
|
||||||
public function paginate($per_page = 20, $columns = array('*'))
|
public function paginate($per_page = 20, $columns = array('*'))
|
||||||
{
|
{
|
||||||
// Because some database engines may throw errors if we leave orderings
|
// Because some database engines may throw errors if we leave orderings
|
||||||
// on the query when retrieving the total number of records, we will
|
// on the query when retrieving the total number of records, we'll drop
|
||||||
// remove all of the ordreings and put them back on the query after
|
// all of the ordreings and put them back on the query after we have
|
||||||
// we have the count.
|
// retrieved the count from the table.
|
||||||
list($orderings, $this->orderings) = array($this->orderings, null);
|
list($orderings, $this->orderings) = array($this->orderings, null);
|
||||||
|
|
||||||
$page = Paginator::page($total = $this->count($columns), $per_page);
|
$page = Paginator::page($total = $this->count($columns), $per_page);
|
||||||
|
|
||||||
$this->orderings = $orderings;
|
$this->orderings = $orderings;
|
||||||
|
|
||||||
// Now we're ready to get the actual pagination results from the
|
// Now we're ready to get the actual pagination results from the table
|
||||||
// database table. The "for_page" method provides a convenient
|
// using the for_page and get methods. The "for_page" method provides
|
||||||
// way to set the limit and offset so we get the correct span
|
// a convenient way to set the limit and offset so we get the correct
|
||||||
// of results from the table.
|
// span of results from the table.
|
||||||
$results = $this->for_page($page, $per_page)->get($columns);
|
$results = $this->for_page($page, $per_page)->get($columns);
|
||||||
|
|
||||||
return Paginator::make($results, $total, $per_page);
|
return Paginator::make($results, $total, $per_page);
|
||||||
|
|
Loading…
Reference in New Issue