You are here

public function GoogleAnalyticsQuery::build in Google Analytics Reports 8.3

Builds the necessary info to execute the query.

Overrides QueryPluginBase::build

File

src/Plugin/views/query/GoogleAnalyticsQuery.php, line 325

Class

GoogleAnalyticsQuery
Defines a Views query class for Google Analytics Reports API.

Namespace

Drupal\google_analytics_reports\Plugin\views\query

Code

public function build(ViewExecutable $view) {

  // 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();
  $view->build_info['count_query'] = $this
    ->query(TRUE);
}