From f013f0819dff96a3907b5250ff2909940aa01bdb Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Wed, 29 May 2013 14:02:12 +0100
Subject: [PATCH] Issue #2002948 by toddtomlinson, jeroen12345: Rename Views
 method use_pager() to usePager().

---
 .../views/Plugin/views/display/DisplayPluginBase.php      | 2 +-
 .../views/lib/Drupal/views/Plugin/views/field/Counter.php | 2 +-
 .../views/lib/Drupal/views/Plugin/views/pager/None.php    | 2 +-
 .../Drupal/views/Plugin/views/pager/PagerPluginBase.php   | 2 +-
 .../views/lib/Drupal/views/Plugin/views/pager/Some.php    | 2 +-
 .../views/lib/Drupal/views/Tests/Plugin/PagerTest.php     | 4 ++--
 core/modules/views/lib/Drupal/views/ViewExecutable.php    | 8 ++++----
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
index 831cdbd57d2d..a577c58fc626 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -283,7 +283,7 @@ public function isPagerEnabled() {
     if ($this->usesPager()) {
       $pager = $this->getPlugin('pager');
       if ($pager) {
-        return $pager->use_pager();
+        return $pager->usePager();
       }
     }
     return FALSE;
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php
index b362bb3de150..e0d932ce2eea 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php
@@ -49,7 +49,7 @@ public function get_value($values, $field = NULL) {
     $count = is_numeric($this->options['counter_start']) ? $this->options['counter_start'] - 1 : 0;
     $pager = $this->view->pager;
     // Get the base count of the pager.
-    if ($pager->use_pager()) {
+    if ($pager->usePager()) {
       $count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->set_offset());
     }
     // Add the counter for the current site.
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php
index f2e1e0ab2a0c..a71538dcba34 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php
@@ -63,7 +63,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  function use_pager() {
+  public function usePager() {
     return FALSE;
   }
 
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php
index 3903da1ae20c..cc932eece4e4 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php
@@ -160,7 +160,7 @@ public function summaryTitle() {
    *
    * Only a couple of very specific pagers will set this to false.
    */
-  function use_pager() {
+  public function usePager() {
     return TRUE;
   }
 
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php
index 835ac7d77b4b..67d4b338c42e 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php
@@ -60,7 +60,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
   }
 
-  function use_pager() {
+  public function usePager() {
     return FALSE;
   }
 
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php
index 13d30ef9a1b7..2114de9f9127 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php
@@ -140,7 +140,7 @@ public function testNoLimit() {
     $this->assertEqual(count($view->result), 8, 'Make sure that every item beside the first three is returned in the result');
 
     // Check some public functions.
-    $this->assertFalse($view->pager->use_pager());
+    $this->assertFalse($view->pager->usePager());
     $this->assertFalse($view->pager->use_count_query());
     $this->assertEqual($view->pager->get_items_per_page(), 0);
   }
@@ -186,7 +186,7 @@ public function testLimit() {
     $this->assertEqual(count($view->result), 3, 'Make sure that only a certain count of items is returned');
 
     // Check some public functions.
-    $this->assertFalse($view->pager->use_pager());
+    $this->assertFalse($view->pager->usePager());
     $this->assertFalse($view->pager->use_count_query());
   }
 
diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php
index 18471d581e19..6fa51d6b1550 100644
--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php
+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -525,7 +525,7 @@ public function setOffset($offset) {
    */
   public function usePager() {
     if (!empty($this->pager)) {
-      return $this->pager->use_pager();
+      return $this->pager->usePager();
     }
   }
 
@@ -726,7 +726,7 @@ public function initPager() {
     if (!isset($this->pager)) {
       $this->pager = $this->display_handler->getPlugin('pager');
 
-      if ($this->pager->use_pager()) {
+      if ($this->pager->usePager()) {
         $this->pager->set_current_page($this->current_page);
       }
 
@@ -746,7 +746,7 @@ public function initPager() {
    * Render the pager, if necessary.
    */
   public function renderPager($exposed_input) {
-    if (!empty($this->pager) && $this->pager->use_pager()) {
+    if (!empty($this->pager) && $this->pager->usePager()) {
       return $this->pager->render($exposed_input);
     }
 
@@ -1176,7 +1176,7 @@ public function execute($display_id = NULL) {
       $cache = $this->display_handler->getPlugin('cache');
     }
     if ($cache->cache_get('results')) {
-      if ($this->pager->use_pager()) {
+      if ($this->pager->usePager()) {
         $this->pager->total_items = $this->total_rows;
         $this->pager->update_page_info();
       }
-- 
GitLab