You are here

protected function RelationRelationship::ensureNoDuplicateEntities in Relation 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/relationship/RelationRelationship.php \Drupal\relation\Plugin\views\relationship\RelationRelationship::ensureNoDuplicateEntities()
1 call to RelationRelationship::ensureNoDuplicateEntities()
RelationRelationship::query in src/Plugin/views/relationship/RelationRelationship.php
Add anything to the query that we might need to.

File

src/Plugin/views/relationship/RelationRelationship.php, line 193
Views relationship support.

Class

RelationRelationship
Relate entities using a Relation endpoint.

Namespace

Drupal\relation\Plugin\views\relationship

Code

protected function ensureNoDuplicateEntities(&$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}";
}