Commit 99c2b590 authored by alexpott's avatar alexpott
Browse files

Issue #2003276 by markie, jibran: Rename Views method set_offset() to setOffset().

parent ba51ddf2
......@@ -50,7 +50,7 @@ public function getValue($values, $field = NULL) {
$pager = $this->view->pager;
// Get the base count of the pager.
if ($pager->usePager()) {
$count += ($pager->get_items_per_page() * $pager->getCurrentPage() + $pager->set_offset());
$count += ($pager->get_items_per_page() * $pager->getCurrentPage() + $pager->setOffset());
}
// Add the counter for the current site.
$count += $this->view->row_index + 1;
......
......@@ -86,7 +86,7 @@ public function postExecute(&$result) {
public function query() {
// The only query modifications we might do are offsets.
if (!empty($this->options['offset'])) {
$this->view->query->set_offset($this->options['offset']);
$this->view->query->setOffset($this->options['offset']);
}
}
......
......@@ -94,7 +94,7 @@ public function getOffset() {
/**
* Set the page offset, or how many items to skip.
*/
function set_offset($offset) {
public function setOffset($offset) {
$this->options['offset'] = $offset;
}
......
......@@ -70,7 +70,7 @@ public function useCountQuery() {
public function query() {
$this->view->query->setLimit($this->options['items_per_page']);
$this->view->query->set_offset($this->options['offset']);
$this->view->query->setOffset($this->options['offset']);
}
}
......@@ -238,7 +238,7 @@ public function query() {
}
$this->view->query->setLimit($limit);
$this->view->query->set_offset($offset);
$this->view->query->setOffset($offset);
}
......
......@@ -106,7 +106,7 @@ public function setLimit($limit) {
/**
* Set an OFFSET on the query, specifying a number of results to skip
*/
function set_offset($offset) {
public function setOffset($offset) {
$this->offset = $offset;
}
......
......@@ -279,7 +279,7 @@ function testPagerApi() {
$this->assertEqual($view->getOffset(), NULL, 'If the pager is not initialized and no manual override there is no offset.');
$rand_number = rand(1, 5);
$view->setOffset($rand_number);
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of set_offset.');
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of setOffset.');
$this->assertEqual($view->getCurrentPage(), NULL, 'If the pager is not initialized and no manual override there is no current page.');
$rand_number = rand(1, 5);
......@@ -304,8 +304,8 @@ function testPagerApi() {
$rand_number = rand(1, 5);
$view->setOffset($rand_number);
$rand_number = rand(6, 11);
$view->pager->set_offset($rand_number);
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of set_offset.');
$view->pager->setOffset($rand_number);
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of setOffset.');
$this->assertEqual($view->getCurrentPage(), 0, 'Per default the current page is 0.');
$rand_number = rand(1, 5);
......
......@@ -516,7 +516,7 @@ public function setOffset($offset) {
// If the pager is already initialized, pass it through to the pager.
if (!empty($this->pager)) {
$this->pager->set_offset($offset);
$this->pager->setOffset($offset);
}
}
......@@ -740,7 +740,7 @@ public function initPager() {
}
if (isset($this->offset)) {
$this->pager->set_offset($this->offset);
$this->pager->setOffset($this->offset);
}
}
}
......
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