function Sql::setDistinct

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::setDistinct()
  2. 10 core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::setDistinct()
  3. 11.x core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::setDistinct()

Set the view to be distinct (per base field).

Parameters

bool $value: Should the view be distincted.

1 call to Sql::setDistinct()
Sql::build in core/modules/views/src/Plugin/views/query/Sql.php
Builds the necessary info to execute the query.

File

core/modules/views/src/Plugin/views/query/Sql.php, line 243

Class

Sql
Views query plugin for an SQL query.

Namespace

Drupal\views\Plugin\views\query

Code

protected function setDistinct($value = TRUE) {
    if (!(isset($this->noDistinct) && $value)) {
        $this->distinct = $value;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.