From 2c2ae72033a2b3d3cb869e72cf2dd2f247dc5c2b Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 29 May 2013 12:14:17 +0100 Subject: [PATCH] Issue #2002332 by mikedotexe, elvis2: Rename Views method add_table() to addTable(). --- .../Plugin/views/relationship/EntityReverse.php | 2 +- .../Drupal/search/Plugin/views/argument/Search.php | 2 +- .../lib/Drupal/search/Plugin/views/filter/Search.php | 2 +- .../Plugin/views/relationship/NodeTermData.php | 2 +- .../views/lib/Drupal/views/ManyToOneHelper.php | 12 ++++++------ .../Plugin/views/argument/ArgumentPluginBase.php | 2 +- .../lib/Drupal/views/Plugin/views/query/Sql.php | 6 +++--- .../Drupal/views/Plugin/views/sort/MenuHierarchy.php | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php b/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php index 6ae211878b..02ee8e97bc 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php @@ -65,7 +65,7 @@ public function query() { $first_join = drupal_container()->get('plugin.manager.views.join')->createInstance($id, $first); - $this->first_alias = $this->query->add_table($this->definition['field table'], $this->relationship, $first_join); + $this->first_alias = $this->query->addTable($this->definition['field table'], $this->relationship, $first_join); // Second, relate the field table to the entity specified using // the entity id on the field table and the entity's id field. diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php index 79aa674a10..6d73cbce7f 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php @@ -79,7 +79,7 @@ public function query($group_by = FALSE) { $search_condition->condition("$search_index.type", $base_table); if (!$this->search_query->simple()) { - $search_dataset = $this->query->add_table('search_dataset'); + $search_dataset = $this->query->addTable('search_dataset'); $conditions = $this->search_query->conditions(); $condition_conditions =& $conditions->conditions(); foreach ($condition_conditions as $key => &$condition) { diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php index a5bf6a3597..9dcbd723ae 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php @@ -159,7 +159,7 @@ public function query() { } $search_condition->condition("$search_index.type", $base_table); if (!$this->search_query->simple()) { - $search_dataset = $this->query->add_table('search_dataset'); + $search_dataset = $this->query->addTable('search_dataset'); $conditions = $this->search_query->conditions(); $condition_conditions =& $conditions->conditions(); foreach ($condition_conditions as $key => &$condition) { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php index f365c3ad12..dd52645471 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php @@ -72,7 +72,7 @@ public function query() { $def['table'] = 'taxonomy_term_data'; if (!array_filter($this->options['vids'])) { - $taxonomy_index = $this->query->add_table('taxonomy_index', $this->relationship); + $taxonomy_index = $this->query->addTable('taxonomy_index', $this->relationship); $def['left_table'] = $taxonomy_index; $def['left_field'] = 'tid'; $def['field'] = 'tid'; diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php index 392d3fc677..895eab75ba 100644 --- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php @@ -65,7 +65,7 @@ public function getField() { * link point and adds *that* as a new relationship and then adds the table to * the relationship, if necessary. */ - function add_table($join = NULL, $alias = NULL) { + public function addTable($join = NULL, $alias = NULL) { // This is used for lookups in the many_to_one table. $field = $this->handler->relationship . '_' . $this->handler->table . '.' . $this->handler->field; @@ -97,7 +97,7 @@ function add_table($join = NULL, $alias = NULL) { } // And now add our table, using the new relationship if one was used. - $alias = $this->handler->query->add_table($this->handler->table, $relationship, $join, $alias); + $alias = $this->handler->query->addTable($this->handler->table, $relationship, $join, $alias); // Store what values are used by this table chain so that other chains can // automatically discard those values. @@ -148,7 +148,7 @@ function summary_join() { ); } } - return $this->add_table($join); + return $this->addTable($join); } } @@ -188,7 +188,7 @@ public function ensureMyTable() { } } - $this->handler->tableAlias = $this->add_table($join); + $this->handler->tableAlias = $this->addTable($join); } return $this->handler->tableAlias; @@ -220,7 +220,7 @@ public function ensureMyTable() { } $this->handler->view->many_to_one_aliases[$field][$value] = $this->handler->table . '_value_' . ($this->handler->view->many_to_one_count[$this->handler->table]++); } - $alias = $this->handler->tableAliases[$value] = $this->add_table($join, $this->handler->view->many_to_one_aliases[$field][$value]); + $alias = $this->handler->tableAliases[$value] = $this->addTable($join, $this->handler->view->many_to_one_aliases[$field][$value]); // and set table_alias to the first of these. if (empty($this->handler->tableAlias)) { @@ -244,7 +244,7 @@ public function ensureMyTable() { ); } - $this->handler->tableAlias = $this->add_table($join); + $this->handler->tableAlias = $this->addTable($join); } } return $this->handler->tableAlias; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index 5f4ba17124..b07a4162c9 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -828,7 +828,7 @@ function summary_name_field() { if ($j) { $join = clone $j; $join->leftTable = $this->tableAlias; - $this->name_table_alias = $this->query->add_table($this->name_table, $this->relationship, $join); + $this->name_table_alias = $this->query->addTable($this->name_table, $this->relationship, $join); } } else { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php index ee682ce5f9..3ca4f573a4 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -364,7 +364,7 @@ function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NUL * adding parts to the query. Or FALSE if the table was not able to be * added. */ - function add_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $alias = NULL) { + public function addTable($table, $relationship = NULL, JoinPluginBase $join = NULL, $alias = NULL) { if (!$this->ensure_path($table, $relationship, $join)) { return FALSE; } @@ -379,7 +379,7 @@ function add_table($table, $relationship = NULL, JoinPluginBase $join = NULL, $a /** * Add a table to the query without ensuring the path. * - * This is a pretty internal function to Views and add_table() or + * This is a pretty internal function to Views and addTable() or * ensure_table() should be used instead of this one, unless you are * absolutely sure this is what you want. * @@ -554,7 +554,7 @@ function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) // // This can be done safely here but not lower down in // queue_table(), because queue_table() is also used by - // add_table() which requires the ability to intentionally add + // addTable() which requires the ability to intentionally add // the same table with the same join multiple times. For // example, a view that filters on 3 taxonomy terms using AND // needs to join taxonomy_term_data 3 times with the same join. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php b/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php index d1cdb69202..be3a7cd6aa 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/sort/MenuHierarchy.php @@ -53,7 +53,7 @@ public function query() { ); $join = Views::pluginManager('join')->createInstance('standard', $definition); - $menu_links = $this->query->add_table('menu_links', NULL, $join); + $menu_links = $this->query->addTable('menu_links', NULL, $join); $this->query->add_orderby($menu_links, 'weight', $this->options['order']); $this->query->add_orderby($menu_links, 'link_title', $this->options['order']); } -- GitLab