setDistinct example


  public function alter(ViewExecutable $view) {
    \Drupal::moduleHandler()->invokeAll('views_query_alter', [$view$this]);
  }

  /** * Builds the necessary info to execute the query. */
  public function build(ViewExecutable $view) {
    // Make the query distinct if the option was set.     if (!empty($this->options['distinct'])) {
      $this->setDistinct(TRUE);
    }

    // Store the view in the object to be able to use it later.     $this->view = $view;

    $view->initPager();

    // Let the pager modify the query to add limits.     $view->pager->query();

    $view->build_info['query'] = $this->query();
    
Home | Imprint | This part of the site doesn't use cookies.