function ViewExecutable::__construct

Same name in other branches
  1. 9 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::__construct()
  2. 8.9.x 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.

\Drupal\views\Plugin\ViewsPluginManager|null $displayPluginManager: The plugin manager for display.

File

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

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, ?ViewsPluginManager $displayPluginManager = NULL) {
    // 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;
    if ($this->displayPluginManager === NULL) {
        @trigger_error('Calling ' . __METHOD__ . ' without the $displayPluginManager argument is deprecated in drupal:10.3.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3410349', E_USER_DEPRECATED);
        $this->displayPluginManager = \Drupal::service('plugin.manager.views.display');
    }
}

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