You are here

class ViewExecutableFactory in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/ViewExecutableFactory.php \Drupal\views\ViewExecutableFactory

Defines the cache backend factory.

Hierarchy

Expanded class hierarchy of ViewExecutableFactory

7 files declare their use of ViewExecutableFactory
ViewAjaxController.php in core/modules/views/src/Controller/ViewAjaxController.php
Contains \Drupal\views\Controller\ViewAjaxController.
ViewExecutableFactoryTest.php in core/modules/views/tests/src/Unit/ViewExecutableFactoryTest.php
Contains \Drupal\Tests\views\Unit\ViewExecutableFactoryTest.
ViewExecutableTest.php in core/modules/views/src/Tests/ViewExecutableTest.php
Contains \Drupal\views\Tests\ViewExecutableTest.
ViewListBuilderTest.php in core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
Contains \Drupal\Tests\views_ui\Unit\ViewListBuilderTest.
ViewsBlockBase.php in core/modules/views/src/Plugin/Block/ViewsBlockBase.php
Contains \Drupal\views\Plugin\Block\ViewsBlockBase.

... See full list

1 string reference to 'ViewExecutableFactory'
views.services.yml in core/modules/views/views.services.yml
core/modules/views/views.services.yml
1 service uses ViewExecutableFactory
views.executable in core/modules/views/views.services.yml
Drupal\views\ViewExecutableFactory

File

core/modules/views/src/ViewExecutableFactory.php, line 17
Contains \Drupal\views\ViewExecutableFactory.

Namespace

Drupal\views
View source
class ViewExecutableFactory {

  /**
   * Stores the current user.
   *
   * @var \Drupal\Core\Session\AccountInterface
   */
  protected $user;

  /**
   * The request stack.
   *
   * @var \Symfony\Component\HttpFoundation\RequestStack
   */
  protected $requestStack;

  /**
   * The views data.
   *
   * @var \Drupal\views\ViewsData
   */
  protected $viewsData;

  /**
   * The route provider.
   *
   * @var \Drupal\Core\Routing\RouteProviderInterface
   */
  protected $routeProvider;

  /**
   * Constructs a new ViewExecutableFactory
   *
   * @param \Drupal\Core\Session\AccountInterface $user
   *   The current user.
   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
   *   The request stack.
   * @param \Drupal\views\ViewsData $views_data
   *   The views data.
   * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
   *   The route provider.
   */
  public function __construct(AccountInterface $user, RequestStack $request_stack, ViewsData $views_data, RouteProviderInterface $route_provider) {
    $this->user = $user;
    $this->requestStack = $request_stack;
    $this->viewsData = $views_data;
    $this->routeProvider = $route_provider;
  }

  /**
   * Instantiates a ViewExecutable class.
   *
   * @param \Drupal\views\ViewEntityInterface $view
   *   A view entity instance.
   *
   * @return \Drupal\views\ViewExecutable
   *   A ViewExecutable instance.
   */
  public function get(ViewEntityInterface $view) {
    $view = new ViewExecutable($view, $this->user, $this->viewsData, $this->routeProvider);
    $view
      ->setRequest($this->requestStack
      ->getCurrentRequest());
    return $view;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ViewExecutableFactory::$requestStack protected property The request stack.
ViewExecutableFactory::$routeProvider protected property The route provider.
ViewExecutableFactory::$user protected property Stores the current user.
ViewExecutableFactory::$viewsData protected property The views data.
ViewExecutableFactory::get public function Instantiates a ViewExecutable class.
ViewExecutableFactory::__construct public function Constructs a new ViewExecutableFactory