function ViewExecutable::__construct

Same name in other branches
  1. 8.9.x core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::__construct()
  2. 10 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::__construct()
  3. 11.x core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::__construct()

Constructs a new ViewExecutable object.

Parameters

\Drupal\views\ViewEntityInterface $storage: The view config entity the actual information is stored on.

\Drupal\Core\Session\AccountInterface $user: The current user.

\Drupal\views\ViewsData $views_data: The views data.

\Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider.

File

core/modules/views/src/ViewExecutable.php, line 465

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function __construct(ViewEntityInterface $storage, AccountInterface $user, ViewsData $views_data, RouteProviderInterface $route_provider) {
    // Reference the storage and the executable to each other.
    $this->storage = $storage;
    $this->storage
        ->set('executable', $this);
    $this->user = $user;
    $this->viewsData = $views_data;
    $this->routeProvider = $route_provider;
}

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