diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php index 5ff1fe6..a02f946 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php @@ -63,7 +63,7 @@ public function query($group_by = FALSE) { ->condition("$this->tableAlias.uid", $this->argument, '=') ->exists($subselect); - $this->query->add_where(0, $condition); + $this->query->addWhere(0, $condition); } /** diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/UserUid.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/UserUid.php index b1c83f8..ab74b4d 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/UserUid.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/UserUid.php @@ -32,7 +32,7 @@ public function query() { ->condition("$this->tableAlias.uid", $this->value, $this->operator) ->exists($subselect); - $this->query->add_where($this->options['group'], $condition); + $this->query->addWhere($this->options['group'], $condition); } } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php index 512f407..255f2c1 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php @@ -147,12 +147,12 @@ public function query() { } } - $this->view->query->add_where(0, $conditions); + $this->view->query->addWhere(0, $conditions); } // Add an IN condition for validation. if (!empty($options['ids'])) { - $this->view->query->add_where(0, $id_field, $options['ids']); + $this->view->query->addWhere(0, $id_field, $options['ids']); } $this->view->setItemsPerPage($options['limit']); diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/filter/Access.php b/core/modules/node/lib/Drupal/node/Plugin/views/filter/Access.php index f9e66b9..c7b7f7b 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/filter/Access.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/filter/Access.php @@ -41,8 +41,8 @@ public function query() { } } - $this->query->add_where('AND', $grants); - $this->query->add_where('AND', $table . '.grant_view', 1, '>='); + $this->query->addWhere('AND', $grants); + $this->query->addWhere('AND', $table . '.grant_view', 1, '>='); } } 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 79aa674..d6193c1 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 @@ -50,7 +50,7 @@ public function query($group_by = FALSE) { } if ($required) { if ($this->operator == 'required') { - $this->query->add_where(0, 'FALSE'); + $this->query->addWhere(0, 'FALSE'); } } else { @@ -102,7 +102,7 @@ public function query($group_by = FALSE) { $search_condition->condition($or); } - $this->query->add_where(0, $search_condition); + $this->query->addWhere(0, $search_condition); $this->query->add_groupby("$search_index.sid"); $matches = $this->search_query->matches(); $placeholder = $this->placeholder(); 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 a5bf6a3..de76f01 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 @@ -130,7 +130,7 @@ public function query() { } if ($required) { if ($this->operator == 'required') { - $this->query->add_where($this->options['group'], 'FALSE'); + $this->query->addWhere($this->options['group'], 'FALSE'); } } else { @@ -182,7 +182,7 @@ public function query() { $search_condition->condition($or); } - $this->query->add_where($this->options['group'], $search_condition); + $this->query->addWhere($this->options['group'], $search_condition); $this->query->add_groupby("$search_index.sid"); $matches = $this->search_query->matches(); $placeholder = $this->placeholder(); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/IndexTidDepth.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/IndexTidDepth.php index 7c5a0eb..f22124d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/IndexTidDepth.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/IndexTidDepth.php @@ -143,7 +143,7 @@ public function query($group_by = FALSE) { } $subquery->condition($where); - $this->query->add_where(0, "$this->tableAlias.$this->realField", $subquery, 'IN'); + $this->query->addWhere(0, "$this->tableAlias.$this->realField", $subquery, 'IN'); } function title() { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php index 4ceb482..636a501 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTidDepth.php @@ -102,7 +102,7 @@ public function query() { } $subquery->condition($where); - $this->query->add_where($this->options['group'], "$this->tableAlias.$this->realField", $subquery, 'IN'); + $this->query->addWhere($this->options['group'], "$this->tableAlias.$this->realField", $subquery, 'IN'); } } 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 e004509..4582da3 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 @@ -27,7 +27,7 @@ public function query($group_by = FALSE) { // 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'); - $this->query->add_where(0, "$tracker_user_alias.uid", $this->argument); + $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 54ea37b..dd72650 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 @@ -27,7 +27,7 @@ public function query() { // 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'); - $this->query->add_where(0, "$tracker_user_alias.uid", $this->value); + $this->query->addWhere(0, "$tracker_user_alias.uid", $this->value); } } diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Current.php b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Current.php index 26dfd9a..ce9d26e 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Current.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Current.php @@ -45,7 +45,7 @@ public function query() { else { $or->condition($field, '***CURRENT_USER***', '='); } - $this->query->add_where($this->options['group'], $or); + $this->query->addWhere($this->options['group'], $or); } } diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php index 392d3fc..923c0b1 100644 --- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php @@ -325,7 +325,7 @@ function add_filter() { } // implode on either AND or OR. - $this->handler->query->add_where($options['group'], $clause); + $this->handler->query->addWhere($options['group'], $clause); } } 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 c1d7724..9fe434c 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 @@ -910,7 +910,7 @@ function summary_name($data) { */ public function query($group_by = FALSE) { $this->ensureMyTable(); - $this->query->add_where(0, "$this->tableAlias.$this->realField", $this->argument); + $this->query->addWhere(0, "$this->tableAlias.$this->realField", $this->argument); } /** diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/Formula.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/Formula.php index 64eddc9..a5d1beb 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/Formula.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/Formula.php @@ -68,7 +68,7 @@ public function query($group_by = FALSE) { $placeholders = array( $placeholder => $this->argument, ); - $this->query->add_where(0, $formula, $placeholders, 'formula'); + $this->query->addWhere(0, $formula, $placeholders, 'formula'); } } 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 803d31a..c7a3550 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 @@ -115,7 +115,7 @@ public function query($group_by = FALSE) { } if ($empty) { parent::ensureMyTable(); - $this->query->add_where(0, "$this->tableAlias.$this->realField", NULL, 'IS NULL'); + $this->query->addWhere(0, "$this->tableAlias.$this->realField", NULL, 'IS NULL'); return; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/String.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/String.php index 7047df2..c9a7c46 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/String.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/String.php @@ -237,7 +237,7 @@ public function query($group_by = FALSE) { $this->query->add_where_expression(0, $field, $placeholders); } else { - $this->query->add_where(0, $field, $argument, $operator); + $this->query->addWhere(0, $field, $argument, $operator); } } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php index e5327f1..78efbaa 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperator.php @@ -174,18 +174,18 @@ public function query() { $or = db_or() ->condition($field, 0, '=') ->condition($field, NULL, 'IS NULL'); - $this->query->add_where($this->options['group'], $or); + $this->query->addWhere($this->options['group'], $or); } else { - $this->query->add_where($this->options['group'], $field, 0, '='); + $this->query->addWhere($this->options['group'], $field, 0, '='); } } else { if (!empty($this->definition['use_equal'])) { - $this->query->add_where($this->options['group'], $field, 1, '='); + $this->query->addWhere($this->options['group'], $field, 1, '='); } else { - $this->query->add_where($this->options['group'], $field, 0, '<>'); + $this->query->addWhere($this->options['group'], $field, 0, '<>'); } } } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php index d19fc6a..b92bcbf 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/BooleanOperatorString.php @@ -37,7 +37,7 @@ public function query() { else { $where .= "<> ''"; } - $this->query->add_where($this->options['group'], $where); + $this->query->addWhere($this->options['group'], $where); } } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php index 74b0b0a..67881b5 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php @@ -1416,7 +1416,7 @@ public function storeExposedInput($input, $status) { */ public function query() { $this->ensureMyTable(); - $this->query->add_where($this->options['group'], "$this->tableAlias.$this->realField", $this->value, $this->operator); + $this->query->addWhere($this->options['group'], "$this->tableAlias.$this->realField", $this->value, $this->operator); } /** diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php index dfe89ea..249de4a 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php @@ -384,7 +384,7 @@ function op_simple() { // We use array_values() because the checkboxes keep keys and that can cause // array addition problems. - $this->query->add_where($this->options['group'], "$this->tableAlias.$this->realField", array_values($this->value), $this->operator); + $this->query->addWhere($this->options['group'], "$this->tableAlias.$this->realField", array_values($this->value), $this->operator); } function op_empty() { @@ -396,7 +396,7 @@ function op_empty() { $operator = "IS NOT NULL"; } - $this->query->add_where($this->options['group'], "$this->tableAlias.$this->realField", NULL, $operator); + $this->query->addWhere($this->options['group'], "$this->tableAlias.$this->realField", NULL, $operator); } public function validate() { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php index 3c2f753..7c4aefe 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/Numeric.php @@ -253,15 +253,15 @@ public function query() { function op_between($field) { if ($this->operator == 'between') { - $this->query->add_where($this->options['group'], $field, array($this->value['min'], $this->value['max']), 'BETWEEN'); + $this->query->addWhere($this->options['group'], $field, array($this->value['min'], $this->value['max']), 'BETWEEN'); } else { - $this->query->add_where($this->options['group'], db_or()->condition($field, $this->value['min'], '<=')->condition($field, $this->value['max'], '>=')); + $this->query->addWhere($this->options['group'], db_or()->condition($field, $this->value['min'], '<=')->condition($field, $this->value['max'], '>=')); } } function op_simple($field) { - $this->query->add_where($this->options['group'], $field, $this->value['value'], $this->operator); + $this->query->addWhere($this->options['group'], $field, $this->value['value'], $this->operator); } function op_empty($field) { @@ -272,11 +272,11 @@ function op_empty($field) { $operator = "IS NOT NULL"; } - $this->query->add_where($this->options['group'], $field, NULL, $operator); + $this->query->addWhere($this->options['group'], $field, NULL, $operator); } function op_regex($field) { - $this->query->add_where($this->options['group'], $field, $this->value, 'RLIKE'); + $this->query->addWhere($this->options['group'], $field, $this->value, 'RLIKE'); } public function adminSummary() { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php index c80e39d..b9a6ee7 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/String.php @@ -261,11 +261,11 @@ public function query() { } function op_equal($field) { - $this->query->add_where($this->options['group'], $field, $this->value, $this->operator()); + $this->query->addWhere($this->options['group'], $field, $this->value, $this->operator()); } function op_contains($field) { - $this->query->add_where($this->options['group'], $field, '%' . db_like($this->value) . '%', 'LIKE'); + $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value) . '%', 'LIKE'); } function op_word($field) { @@ -298,27 +298,27 @@ function op_word($field) { // previously this was a call_user_func_array but that's unnecessary // as views will unpack an array that is a single arg. - $this->query->add_where($this->options['group'], $where); + $this->query->addWhere($this->options['group'], $where); } function op_starts($field) { - $this->query->add_where($this->options['group'], $field, db_like($this->value) . '%', 'LIKE'); + $this->query->addWhere($this->options['group'], $field, db_like($this->value) . '%', 'LIKE'); } function op_not_starts($field) { - $this->query->add_where($this->options['group'], $field, db_like($this->value) . '%', 'NOT LIKE'); + $this->query->addWhere($this->options['group'], $field, db_like($this->value) . '%', 'NOT LIKE'); } function op_ends($field) { - $this->query->add_where($this->options['group'], $field, '%' . db_like($this->value), 'LIKE'); + $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value), 'LIKE'); } function op_not_ends($field) { - $this->query->add_where($this->options['group'], $field, '%' . db_like($this->value), 'NOT LIKE'); + $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value), 'NOT LIKE'); } function op_not($field) { - $this->query->add_where($this->options['group'], $field, '%' . db_like($this->value) . '%', 'NOT LIKE'); + $this->query->addWhere($this->options['group'], $field, '%' . db_like($this->value) . '%', 'NOT LIKE'); } function op_shorter($field) { @@ -332,7 +332,7 @@ function op_longer($field) { } function op_regex($field) { - $this->query->add_where($this->options['group'], $field, $this->value, 'RLIKE'); + $this->query->addWhere($this->options['group'], $field, $this->value, 'RLIKE'); } function op_empty($field) { @@ -343,7 +343,7 @@ function op_empty($field) { $operator = "IS NOT NULL"; } - $this->query->add_where($this->options['group'], $field, NULL, $operator); + $this->query->addWhere($this->options['group'], $field, NULL, $operator); } } 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 9899403..8cff444 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 @@ -823,7 +823,7 @@ function clear_fields() { * The $field, $value and $operator arguments can also be passed in with a * single DatabaseCondition object, like this: * @code - * $this->query->add_where( + * $this->query->addWhere( * $this->options['group'], * db_or() * ->condition($field, $value, 'NOT IN') @@ -834,7 +834,7 @@ function clear_fields() { * @see Drupal\Core\Database\Query\ConditionInterface::condition() * @see Drupal\Core\Database\Query\Condition */ - function add_where($group, $field, $value = NULL, $operator = NULL) { + public function addWhere($group, $field, $value = NULL, $operator = NULL) { // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all // the default group. if (empty($group)) { 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 a058bb3..4acff71 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 @@ -60,7 +60,7 @@ public function setAllItems($allItems) { $this->allItems = $allItems; } - public function add_where($group, $field, $value = NULL, $operator = NULL) { + public public function addWhere($group, $field, $value = NULL, $operator = NULL) { $this->conditions[] = array( 'field' => $field, 'value' => $value,