From b7eac0fd335a9fec9a8f97d9f7afc8acfd218302 Mon Sep 17 00:00:00 2001 From: Ryan Mayberry Date: Sun, 18 Oct 2009 00:39:03 +0800 Subject: [PATCH] added offset property for query offset --- classes/kohana/pagination.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/kohana/pagination.php b/classes/kohana/pagination.php index 57302b1..6fbea56 100644 --- a/classes/kohana/pagination.php +++ b/classes/kohana/pagination.php @@ -48,6 +48,9 @@ class Kohana_Pagination { // Last page number; FALSE if the current page is the last one protected $last_page; + // Query offset + protected $offset; + /** * Creates a new Pagination object. * @@ -156,11 +159,12 @@ class Kohana_Pagination { $this->next_page = ($this->current_page < $this->total_pages) ? $this->current_page + 1 : FALSE; $this->first_page = ($this->current_page === 1) ? FALSE : 1; $this->last_page = ($this->current_page >= $this->total_pages) ? FALSE : $this->total_pages; + $this->offset = (int) (($this->items_per_page * $this->current_page) - $this->items_per_page); } // Chainable method return $this; - } + } /** * Generates the full URL for a certain page. -- 2.11.4.GIT