You are here

protected function relation_handler_relationship::ensure_no_duplicate_entities in Relation 7

1 call to relation_handler_relationship::ensure_no_duplicate_entities()
relation_handler_relationship::query in views/relation_handler_relationship.inc
Called to implement a relationship in a query.

File

views/relation_handler_relationship.inc, line 166
Views relationship support.

Class

relation_handler_relationship
@file Views relationship support.

Code

protected function ensure_no_duplicate_entities(&$extra, $check, $relation_type, $entity_type, $table, $field) {
  if ($check && isset($this->view->relation_entity_tables[$entity_type][$relation_type])) {
    foreach ($this->view->relation_entity_tables[$entity_type][$relation_type] as $expression) {
      $extra[] = array(
        'table' => NULL,
        'field' => "{$expression} != {$table}.{$field} AND 1",
        'value' => 1,
      );
    }
  }
  $this->view->relation_entity_tables[$entity_type][$relation_type][] = "{$table}.{$field}";
}