You are here

public function ActivityPlugin::build in Activity 8

Implements Drupal\views\Plugin\views\query\QueryPluginBase::build().

Parameters

\Drupal\views\ViewExecutable $view: The view.

Overrides QueryPluginBase::build

File

src/Plugin/views/query/ActivityPlugin.php, line 218

Class

ActivityPlugin
Activity views query plugin which display all activities.

Namespace

Drupal\activity\Plugin\views\query

Code

public function build(ViewExecutable $view) {
  $this->view = $view;
  $view
    ->initPager();

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

  // Clear cache in order to obtain the right result.
  Cache::invalidateTags([
    'config:views.view.' . $view
      ->id(),
  ]);
  $view->build_info['query'] = $this->activities;
  $view->build_info['count_query'] = $this->activityQuery
    ->countMessages();
}