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 5ff1fe6e5b7ce3374e9738b2af2d00e4145028c7..a02f946f0074c37234ff92f63e4638518d83c14f 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 b1c83f89bbffe72a93f518dcee566ee39b3e8d89..ab74b4dbadf3148613086fcb341680956b9c35d5 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 450dad34975e25951a16e8e447b4af9a78737d2c..ea3ec894605d6f485f3d27b8e5ea4852bd44c763 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 f9e66b9e7eeff31877f7b76c5ca33006a2766b3f..c7b7f7b88874bcf9a8c3718cc382561d34ce5c99 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 14a26674361b4a09772042fd5a01374d334bcd8f..11919ddf6276a94f26c087ab26d2e3b323a3fc9b 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 da0c747d3eb79cb9a9486d65250102bf0053dbeb..4ebe91ba48896a433d4d524db4c3d490da3b2207 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 669f004ee90b975f6b07c4736b7ceeb8a35c39ab..a9e1414b67eb82030b21f0e1912c0c988cdbb895 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 e05a4124eddd1bdcff82c2bf6070fa86fe8d1bc8..3bae73d1723e687f68291c7a07e78fada9181c43 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 e00450997fae6ace3ddf00d034c6be204f92dcd0..4582da3ba4eb0162bee6939af1dc74d7e2a424f3 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 54ea37b926a3853a9dd36462f14ac4992c1729f0..dd726501d62dde4997444e08724832393019cbd9 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 26dfd9a444d4cae295997efda989e285b2a77a66..ce9d26ef2069a2ebbd4260e12bdcc253334f6e8f 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 caca5914dff51458ef49e6784f8525b4130073da..baff6789548c1b02ccfc37e2ad4ba2b45c57d3f3 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 29cf9fd72e3cd965ad739ab312ca3fe856dcd89a..d166af8d18856dfafc308881ef64593d6fa62cd5 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 @@ public function summaryName($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 e74ae6fe1e6c01d37ab448671663fe5ed0b27397..b1c89189795e0518951242f4052fb968832f2da3 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 c89cd0ba437b954857dc6e2775b70de7352f59a0..1b79d26418eb278c38e0ae13a7ee8bc2eebfa99f 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 cae4bb42aae5264f4e2b78c261a8e5bf30844e40..5b78756002369a7731b8b1feb7e512d30ae7f0f6 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 8ef336a101762a941197147699c2371eb49a958b..72f3814692f157fd35a7e2321ad29df93acdf0da 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 d19fc6a69fbc88914d0c70b25ef30714f9d05882..b92bcbf000ef37a5bbd8c9ea2accfcbde71b1665 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 63fc004f27342a4ecfb1315773bbc2e7706dbff7..f97c1944ef33d0b3c553a5cc64204dc606af37c9 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 835bb9d3d7c3a67d4010a2be53da899005a9eb8b..70485455087f603616331d2b3916eec09d9d1c1e 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 @@ protected function opSimple() { // 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 b30dbf0f02ed89d2a4916a643befd1df669b6d0f..99896e47eb1feef0b259137c8b1efa6c48132c7f 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() { protected function opBetween($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'], '>=')); } } protected function opSimple($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); } protected function opRegex($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 1ec4ecc72fe24af136033f0915d9c4e3b7eed80f..c392876def9fb97f114798d276fe0de48af90cc6 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() { } public function opEqual($field) { - $this->query->add_where($this->options['group'], $field, $this->value, $this->operator()); + $this->query->addWhere($this->options['group'], $field, $this->value, $this->operator()); } protected function opContains($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'); } protected function opContainsWord($field) { @@ -298,27 +298,27 @@ protected function opContainsWord($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); } protected function opStartsWith($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'); } protected function opNotStartsWith($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'); } protected function opEndsWith($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'); } protected function opNotEnds($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'); } protected function opShorterThan($field) { @@ -332,7 +332,7 @@ protected function opLongerThan($field) { } protected function opRegex($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 b5954b57019d4bed6302fc0130654b4e5e5939f7..b05727199a1a6638196fd6c73ca6b03325514d62 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 @@ public function clearFields() { * 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 @@ public function clearFields() { * @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 a058bb3fa9d56775139097ba8e9dd063d5d8adc2..e37ac8cc378e71f40def8e5aebad26764ab8f405 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 function addWhere($group, $field, $value = NULL, $operator = NULL) { $this->conditions[] = array( 'field' => $field, 'value' => $value,