summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-06-11 23:42:35 +0100
committerAlex Pott2013-06-11 23:42:35 +0100
commitb69a5af30c45af42c9cc7b85ad1a3f1d1428dde1 (patch)
tree18e3c3bccc6a092be7677f561c99d5f6d6972535
parenteb60f6f94966c0db466f6dc06d2839545431c70d (diff)
Issue #2003282 by theladebug, sillygwailo, heddn: Rename Views method set_items_per_page() to setItemsPerPage().
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php6
-rw-r--r--core/modules/views/lib/Drupal/views/ViewExecutable.php4
4 files changed, 7 insertions, 7 deletions
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 4c1558c..3c32623 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
@@ -33,7 +33,7 @@ class None extends PagerPluginBase {
parent::init($view, $display, $options);
// If the pager is set to none, then it should show all items.
- $this->set_items_per_page(0);
+ $this->setItemsPerPage(0);
}
public function summaryTitle() {
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 74f3219..152ea69 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
@@ -77,7 +77,7 @@ abstract class PagerPluginBase extends PluginBase {
*
* This is mostly used for things that will override the value.
*/
- function set_items_per_page($items) {
+ public function setItemsPerPage($items) {
$this->options['items_per_page'] = $items;
}
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 b830b58..cbc8279 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php
@@ -274,7 +274,7 @@ class PagerTest extends PluginTestBase {
$this->assertEqual($view->getItemsPerPage(), NULL, 'If the pager is not initialized and no manual override there is no items per page.');
$rand_number = rand(1, 5);
$view->setItemsPerPage($rand_number);
- $this->assertEqual($view->getItemsPerPage(), $rand_number, 'Make sure getItemsPerPage uses the settings of set_items_per_page.');
+ $this->assertEqual($view->getItemsPerPage(), $rand_number, 'Make sure getItemsPerPage uses the settings of setItemsPerPage.');
$this->assertEqual($view->getOffset(), NULL, 'If the pager is not initialized and no manual override there is no offset.');
$rand_number = rand(1, 5);
@@ -297,8 +297,8 @@ class PagerTest extends PluginTestBase {
$rand_number = rand(1, 5);
$view->setItemsPerPage($rand_number);
$rand_number = rand(6, 11);
- $view->pager->set_items_per_page($rand_number);
- $this->assertEqual($view->getItemsPerPage(), $rand_number, 'Make sure getItemsPerPage uses the settings of set_items_per_page.');
+ $view->pager->setItemsPerPage($rand_number);
+ $this->assertEqual($view->getItemsPerPage(), $rand_number, 'Make sure getItemsPerPage uses the settings of setItemsPerPage.');
$this->assertEqual($view->getOffset(), 0, 'Per default a view has a 0 offset.');
$rand_number = rand(1, 5);
diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php
index 01d224b..26bfe5d 100644
--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php
+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -490,7 +490,7 @@ class ViewExecutable {
// If the pager is already initialized, pass it through to the pager.
if (!empty($this->pager)) {
- $this->pager->set_items_per_page($items_per_page);
+ $this->pager->setItemsPerPage($items_per_page);
}
}
@@ -736,7 +736,7 @@ class ViewExecutable {
// These overrides may have been set earlier via $view->set_*
// functions.
if (isset($this->items_per_page)) {
- $this->pager->set_items_per_page($this->items_per_page);
+ $this->pager->setItemsPerPage($this->items_per_page);
}
if (isset($this->offset)) {