You are here

public function ViewsBulkOperationsViewData::init in Views Bulk Operations (VBO) 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Service/ViewsBulkOperationsViewData.php \Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::init()
  2. 8 src/Service/ViewsBulkOperationsViewData.php \Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::init()
  3. 8.2 src/Service/ViewsBulkOperationsViewData.php \Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData::init()

Initialize additional variables.

Parameters

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

\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The current display plugin.

string $relationship: Relationship ID.

Overrides ViewsBulkOperationsViewDataInterface::init

File

src/Service/ViewsBulkOperationsViewData.php, line 87

Class

ViewsBulkOperationsViewData
Gets Views data needed by VBO.

Namespace

Drupal\views_bulk_operations\Service

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, $relationship) {
  $this->view = $view;
  $this->displayHandler = $display;
  $this->relationship = $relationship;

  // Get view entity types and results fetcher callable.
  $event = new ViewsBulkOperationsEvent($this
    ->getViewProvider(), $this
    ->getData(), $view);
  $this->eventDispatcher
    ->dispatch(ViewsBulkOperationsEvent::NAME, $event);
  $this->entityTypeIds = $event
    ->getEntityTypeIds();
  $this->entityGetter = $event
    ->getEntityGetter();
}