Issue #2001320 by zschmid, chrisguindon, pwieck, chertzog: Rename Views method add_groupby() to addGroupBy().

8.0.x
Alex Pott 2013-06-13 09:14:57 +01:00
parent 281e533bcf
commit 9ce3e06d47
4 changed files with 6 additions and 17 deletions

View File

@ -103,7 +103,7 @@ class Search extends ArgumentPluginBase {
}
$this->query->addWhere(0, $search_condition);
$this->query->add_groupby("$search_index.sid");
$this->query->addGroupBy("$search_index.sid");
$matches = $this->search_query->matches();
$placeholder = $this->placeholder();
$this->query->addHavingExpression(0, "COUNT(*) >= $placeholder", array($placeholder => $matches));

View File

@ -183,7 +183,7 @@ class Search extends FilterPluginBase {
}
$this->query->addWhere($this->options['group'], $search_condition);
$this->query->add_groupby("$search_index.sid");
$this->query->addGroupBy("$search_index.sid");
$matches = $this->search_query->matches();
$placeholder = $this->placeholder();
$this->query->addHavingExpression($this->options['group'], "COUNT(*) >= $placeholder", array($placeholder => $matches));

View File

@ -795,7 +795,7 @@ abstract class ArgumentPluginBase extends HandlerBase {
* Build the info for the summary query.
*
* This must:
* - add_groupby: group on this field in order to create summaries.
* - addGroupBy: group on this field in order to create summaries.
* - addField: add a 'num_nodes' field for the count. Usually it will
* be a count on $view->base_field
* - set_count_field: Reset the count field so we get the right paging.
@ -856,7 +856,7 @@ abstract class ArgumentPluginBase extends HandlerBase {
$distinct = ($this->view->display_handler->getOption('distinct') && empty($this->query->no_distinct));
$count_alias = $this->query->addField($this->view->storage->get('base_table'), $this->view->storage->get('base_field'), 'num_records', array('count' => TRUE, 'distinct' => $distinct));
$this->query->add_groupby($this->name_alias);
$this->query->addGroupBy($this->name_alias);
if ($count_field) {
$this->query->set_count_field($this->tableAlias, $this->realField);

View File

@ -972,17 +972,6 @@ class Sql extends QueryPluginBase {
'field' => $as,
'direction' => strtoupper($order)
);
/**
* -- removing, this should be taken care of by field adding now.
* -- leaving commented because I am unsure.
// If grouping, all items in the order by must also be in the
// group by clause. Check $table to ensure that this is not a
// formula.
if ($this->groupby && $table) {
$this->add_groupby($as);
}
*/
}
/**
@ -990,7 +979,7 @@ class Sql extends QueryPluginBase {
* for ensuring that the fields are fully qualified and the table is properly
* added.
*/
function add_groupby($clause) {
public function addGroupBy($clause) {
// Only add it if it's not already in there.
if (!in_array($clause, $this->groupby)) {
$this->groupby[] = $clause;
@ -1201,7 +1190,7 @@ class Sql extends QueryPluginBase {
// Check query distinct value.
if (empty($this->no_distinct) && $this->distinct && !empty($this->fields)) {
$base_field_alias = $this->addField($this->view->storage->get('base_table'), $this->view->storage->get('base_field'));
$this->add_groupby($base_field_alias);
$this->addGroupBy($base_field_alias);
$distinct = TRUE;
}