Commit 6952fa75 authored by webchick's avatar webchick

Issue #2002968 by zhgenti | heddn: Rename Views method get_offset() to getOffset().

parent db7edce3
......@@ -87,7 +87,7 @@ function set_items_per_page($items) {
* Even pagers that don't actually page can skip items at the beginning,
* so few pagers will need to override this method.
*/
function get_offset() {
public function getOffset() {
return isset($this->options['offset']) ? $this->options['offset'] : 0;
}
......
......@@ -361,7 +361,7 @@ function exposed_form_alter(&$form, &$form_state) {
'#size' => 10,
'#maxlength' => 10,
'#title' => $this->options['expose']['offset_label'],
'#default_value' => $this->get_offset(),
'#default_value' => $this->getOffset(),
);
}
}
......
......@@ -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 get_offset uses the settings of set_offset.');
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of set_offset.');
$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);
......@@ -305,7 +305,7 @@ function testPagerApi() {
$view->setOffset($rand_number);
$rand_number = rand(6, 11);
$view->pager->set_offset($rand_number);
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.');
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of set_offset.');
$this->assertEqual($view->getCurrentPage(), 0, 'Per default the current page is 0.');
$rand_number = rand(1, 5);
......
......@@ -500,7 +500,7 @@ public function setItemsPerPage($items_per_page) {
public function getOffset() {
// If the pager is already initialized, pass it through to the pager.
if (!empty($this->pager)) {
return $this->pager->get_offset();
return $this->pager->getOffset();
}
if (isset($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