diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php index 303cf96..2853ad8 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php @@ -40,7 +40,7 @@ public function query() { $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); // ncs_user alias so this can work with the sort handler, below. - $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join); + $this->user_table = $this->query->ensureTable('ncs_users', $this->relationship, $join); $this->field_alias = $this->query->addField(NULL, "COALESCE($this->user_table.name, $this->tableAlias.$this->field)", $this->tableAlias . '_' . $this->field); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastUpdated.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastUpdated.php index 6c39121..f6209f2 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastUpdated.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastUpdated.php @@ -21,7 +21,7 @@ class NcsLastUpdated extends Date { public function query() { $this->ensureMyTable(); - $this->node_table = $this->query->ensure_table('node', $this->relationship); + $this->node_table = $this->query->ensureTable('node', $this->relationship); $this->field_alias = $this->query->addField(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->tableAlias . '_' . $this->field); } diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NcsLastUpdated.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NcsLastUpdated.php index 7562c94..89f25a1 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NcsLastUpdated.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NcsLastUpdated.php @@ -21,7 +21,7 @@ class NcsLastUpdated extends Date { public function query() { $this->ensureMyTable(); - $this->node_table = $this->query->ensure_table('node', $this->relationship); + $this->node_table = $this->query->ensureTable('node', $this->relationship); $field = "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)"; diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php index fee088e..988aef9 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php @@ -33,7 +33,7 @@ public function query() { // @todo this might be safer if we had an ensure_relationship rather than guessing // the table alias. Though if we did that we'd be guessing the relationship name // so that doesn't matter that much. - $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join); + $this->user_table = $this->query->ensureTable('ncs_users', $this->relationship, $join); $this->user_field = $this->query->addField($this->user_table, 'name'); // Add the field. diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php index dfef21a..5808fe7 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastUpdated.php @@ -21,7 +21,7 @@ class NcsLastUpdated extends Date { public function query() { $this->ensureMyTable(); - $this->node_table = $this->query->ensure_table('node', $this->relationship); + $this->node_table = $this->query->ensureTable('node', $this->relationship); $this->field_alias = $this->query->add_orderby(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field); } diff --git a/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php b/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php index 422f87d..0b96393 100644 --- a/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php +++ b/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php @@ -71,12 +71,12 @@ public function query() { $this->ensureMyTable(); $field = "$this->tableAlias.$this->realField"; - $node = $this->query->ensure_table('node_field_data', $this->relationship); + $node = $this->query->ensureTable('node_field_data', $this->relationship); $clause = ''; $clause2 = ''; if (module_exists('comment')) { - $ncs = $this->query->ensure_table('node_comment_statistics', $this->relationship); + $ncs = $this->query->ensureTable('node_comment_statistics', $this->relationship); $clause = ("OR $ncs.last_comment_timestamp > (***CURRENT_TIME*** - $limit)"); $clause2 = "OR $field < $ncs.last_comment_timestamp"; } diff --git a/core/modules/tracker/lib/Drupal/tracker/Plugin/views/argument/UserUid.php b/core/modules/tracker/lib/Drupal/tracker/Plugin/views/argument/UserUid.php index 4582da3..1df6f94 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Plugin/views/argument/UserUid.php +++ b/core/modules/tracker/lib/Drupal/tracker/Plugin/views/argument/UserUid.php @@ -26,7 +26,7 @@ public function query($group_by = FALSE) { // Because this handler thinks it's an argument for a field on the {node} // table, we need to make sure {tracker_user} is JOINed and use its alias // for the WHERE clause. - $tracker_user_alias = $this->query->ensure_table('tracker_user'); + $tracker_user_alias = $this->query->ensureTable('tracker_user'); $this->query->addWhere(0, "$tracker_user_alias.uid", $this->argument); } diff --git a/core/modules/tracker/lib/Drupal/tracker/Plugin/views/filter/UserUid.php b/core/modules/tracker/lib/Drupal/tracker/Plugin/views/filter/UserUid.php index dd72650..792346e 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Plugin/views/filter/UserUid.php +++ b/core/modules/tracker/lib/Drupal/tracker/Plugin/views/filter/UserUid.php @@ -26,7 +26,7 @@ public function query() { // Because this handler thinks it's an argument for a field on the {node} // table, we need to make sure {tracker_user} is JOINed and use its alias // for the WHERE clause. - $tracker_user_alias = $this->query->ensure_table('tracker_user'); + $tracker_user_alias = $this->query->ensureTable('tracker_user'); $this->query->addWhere(0, "$tracker_user_alias.uid", $this->value); } diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php index baff678..fafcd12 100644 --- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php @@ -133,7 +133,7 @@ function summary_join() { } if (empty($options['add_table']) || empty($view->many_to_one_tables[$field])) { - return $query->ensure_table($this->handler->table, $this->handler->relationship, $join); + return $query->ensureTable($this->handler->table, $this->handler->relationship, $join); } else { if (!empty($view->many_to_one_tables[$field])) { @@ -169,7 +169,7 @@ public function ensureMyTable() { if (isset($join)) { $join->type = 'INNER'; } - $this->handler->tableAlias = $this->handler->query->ensure_table($this->handler->table, $this->handler->relationship, $join); + $this->handler->tableAlias = $this->handler->query->ensureTable($this->handler->table, $this->handler->relationship, $join); $this->handler->view->many_to_one_tables[$field] = $this->handler->value; } else { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index 2525071..cd7bb42 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -527,7 +527,7 @@ public function setRelationship() { */ public function ensureMyTable() { if (!isset($this->tableAlias)) { - $this->tableAlias = $this->query->ensure_table($this->table, $this->relationship); + $this->tableAlias = $this->query->ensureTable($this->table, $this->relationship); } return $this->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 dd86190..6761370 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 @@ -832,7 +832,7 @@ protected function summaryNameField() { } } else { - $this->name_table_alias = $this->query->ensure_table($this->name_table, $this->relationship); + $this->name_table_alias = $this->query->ensureTable($this->name_table, $this->relationship); } } else { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ManyToOne.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ManyToOne.php index 3372f66..aaca7a0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ManyToOne.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ManyToOne.php @@ -170,7 +170,7 @@ protected function summaryQuery() { } if (empty($this->options['add_table']) || empty($this->view->many_to_one_tables[$field])) { - $this->tableAlias = $this->query->ensure_table($this->table, $this->relationship, $join); + $this->tableAlias = $this->query->ensureTable($this->table, $this->relationship, $join); } else { $this->tableAlias = $this->helper->summary_join(); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 328bbfa..b1b0331 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -135,7 +135,7 @@ protected function addAdditionalFields($fields = NULL) { foreach ($fields as $identifier => $info) { if (is_array($info)) { if (isset($info['table'])) { - $table_alias = $this->query->ensure_table($info['table'], $this->relationship); + $table_alias = $this->query->ensureTable($info['table'], $this->relationship); } else { $table_alias = $this->tableAlias; 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 e76eb60..2c130ef 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 @@ -380,7 +380,7 @@ public function addTable($table, $relationship = NULL, JoinPluginBase $join = NU * Add a table to the query without ensuring the path. * * This is a pretty internal function to Views and addTable() or - * ensure_table() should be used instead of this one, unless you are + * ensureTable() should be used instead of this one, unless you are * absolutely sure this is what you want. * * @param $table @@ -508,7 +508,7 @@ protected function markTable($table, $relationship, $alias) { * The alias used to refer to this specific table, or NULL if the table * cannot be ensured. */ - function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) { + pbulic function ensureTable($table, $relationship = NULL, JoinPluginBase $join = NULL) { // ensure a relationship if (empty($relationship)) { $relationship = $this->view->storage->get('base_table'); @@ -660,7 +660,7 @@ function adjust_join($join, $relationship) { if ($join->leftTable != $this->relationships[$relationship]['table'] && $join->leftTable != $this->relationships[$relationship]['base'] && !isset($this->tables[$relationship][$join->leftTable]['alias'])) { - $this->ensure_table($join->leftTable, $relationship); + $this->ensureTable($join->leftTable, $relationship); } // First, if this is our link point/anchor table, just use the relationship @@ -705,7 +705,7 @@ public function getJoinData($table, $base_table) { * Get the information associated with a table. * * If you need the alias of a table with a particular relationship, use - * ensure_table(). + * ensureTable(). */ public function getTableInfo($table) { if (!empty($this->table_queue[$table])) { @@ -723,12 +723,12 @@ public function getTableInfo($table) { /** * Add a field to the query table, possibly with an alias. This will - * automatically call ensure_table to make sure the required table + * automatically call ensureTable to make sure the required table * exists, *unless* $table is unset. * * @param $table * The table this field is attached to. If NULL, it is assumed this will - * be a formula; otherwise, ensure_table is used to make sure the + * be a formula; otherwise, ensureTable is used to make sure the * table exists. * @param $field * The name of the field to add. This may be a real field or a formula. @@ -750,7 +750,7 @@ public function addField($table, $field, $alias = '', $params = array()) { } if ($table && empty($this->table_queue[$table])) { - $this->ensure_table($table); + $this->ensureTable($table); } if (!$alias && $table) { @@ -952,7 +952,7 @@ function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params // Only ensure the table if it's not the special random key. // @todo: Maybe it would make sense to just add a add_orderby_rand or something similar. if ($table && $table != 'rand') { - $this->ensure_table($table); + $this->ensureTable($table); } // Only fill out this aliasing if there is a table; diff --git a/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php index 48545c8..e9b2d22 100644 --- a/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php +++ b/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/query/QueryTest.php @@ -79,7 +79,7 @@ public function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', } - public function ensure_table($table, $relationship = NULL, JoinPluginBase $join = NULL) { + public function ensureTable($table, $relationship = NULL, JoinPluginBase $join = NULL) { // There is no concept of joins. }