Commit 167810ff authored by alexpott's avatar alexpott

Issue #2002340 by elvis2, jibran: Rename Views method add_where() to addWhere().

parent 18e03273
......@@ -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);
}
/**
......
......@@ -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);
}
}
......@@ -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']);
......
......@@ -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, '>=');
}
}
......
......@@ -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();
......
......@@ -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();
......
......@@ -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() {
......
......@@ -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');
}
}
......@@ -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);
}
}
......@@ -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);
}
}
......@@ -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);
}
}
......@@ -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);
}
}
......
......@@ -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);
}
/**
......
......@@ -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');
}
}
......@@ -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;
}
......
......@@ -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);
}
}
......
......@@ -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, '<>');
}
}
}
......
......@@ -37,7 +37,7 @@ public function query() {
else {
$where .= "<> ''";
}
$this->query->add_where($this->options['group'], $where);
$this->query->addWhere($this->options['group'], $where);
}
}
......@@ -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);
}
/**
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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);
}
}
......@@ -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)) {
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment