Issue #2002274 by elvis2: Rename Views method add_relationship() to addRelationship().

8.0.x
Alex Pott 2013-06-08 00:10:08 +01:00
parent cf23ee6e1d
commit 18e03273de
10 changed files with 8 additions and 10 deletions

View File

@ -40,7 +40,6 @@ class NcsLastCommentName extends FieldPluginBase {
$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->add_relationship(NULL, $join, 'users', $this->relationship);
$this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join);
$this->field_alias = $this->query->add_field(NULL, "COALESCE($this->user_table.name, $this->tableAlias.$this->field)", $this->tableAlias . '_' . $this->field);

View File

@ -33,7 +33,6 @@ class NcsLastCommentName extends SortPluginBase {
// @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->add_relationship(NULL, $join, 'users', $this->relationship);
$this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join);
$this->user_field = $this->query->add_field($this->user_table, 'name');

View File

@ -93,7 +93,7 @@ class EntityReverse extends RelationshipPluginBase {
// use a short alias for this:
$alias = $this->definition['field_name'] . '_' . $this->table;
$this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);
$this->alias = $this->query->addRelationship($alias, $second_join, $this->definition['base'], $this->relationship);
}
}

View File

@ -66,7 +66,7 @@ class Search extends ArgumentPluginBase {
'left_field' => 'word',
);
$join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition);
$search_total = $this->query->add_relationship('search_total', $join, $search_index);
$search_total = $this->query->addRelationship('search_total', $join, $search_index);
$this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE));

View File

@ -147,7 +147,7 @@ class Search extends FilterPluginBase {
);
$join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition);
$search_total = $this->query->add_relationship('search_total', $join, $search_index);
$search_total = $this->query->addRelationship('search_total', $join, $search_index);
$this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE));

View File

@ -100,7 +100,7 @@ class NodeTermData extends RelationshipPluginBase {
// use a short alias for this:
$alias = $def['table'] . '_' . $this->table;
$this->alias = $this->query->add_relationship($alias, $join, 'taxonomy_term_data', $this->relationship);
$this->alias = $this->query->addRelationship($alias, $join, 'taxonomy_term_data', $this->relationship);
}
}

View File

@ -93,7 +93,7 @@ class ManyToOneHelper {
}
// If we found that there are tables in between, add the relationship.
if ($r_join->table != $join->table) {
$relationship = $this->handler->query->add_relationship($this->handler->table . '_' . $r_join->table, $r_join, $r_join->table, $this->handler->relationship);
$relationship = $this->handler->query->addRelationship($this->handler->table . '_' . $r_join->table, $r_join, $r_join->table, $this->handler->relationship);
}
// And now add our table, using the new relationship if one was used.

View File

@ -290,7 +290,7 @@ class Sql extends QueryPluginBase {
* might have a relationship to an 'album' node, which might
* have a relationship to an 'artist' node.
*/
function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NULL) {
public function addRelationship($alias, JoinPluginBase $join, $base, $link_point = NULL) {
if (empty($link_point)) {
$link_point = $this->view->storage->get('base_table');
}

View File

@ -383,7 +383,7 @@ class GroupwiseMax extends RelationshipPluginBase {
// use a short alias for this:
$alias = $def['table'] . '_' . $this->table;
$this->alias = $this->query->add_relationship($alias, $join, $this->definition['base'], $this->relationship);
$this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship);
}
}

View File

@ -135,7 +135,7 @@ abstract class RelationshipPluginBase extends HandlerBase {
// use a short alias for this:
$alias = $def['table'] . '_' . $this->table;
$this->alias = $this->query->add_relationship($alias, $join, $this->definition['base'], $this->relationship);
$this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship);
// Add access tags if the base table provide it.
if (empty($this->query->options['disable_sql_rewrite']) && isset($table_data['table']['base']['access query tag'])) {