Commit bbae90ad authored by Taylor Otwell's avatar Taylor Otwell

fix pagination comment.

parent cd17761f
...@@ -655,19 +655,19 @@ class Query { ...@@ -655,19 +655,19 @@ class Query {
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment