You are here

protected function ViewsBulkOperationsActionProcessor::setView in Views Bulk Operations (VBO) 8

Same name and namespace in other branches
  1. 8.3 src/Service/ViewsBulkOperationsActionProcessor.php \Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor::setView()
  2. 8.2 src/Service/ViewsBulkOperationsActionProcessor.php \Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor::setView()
  3. 4.0.x src/Service/ViewsBulkOperationsActionProcessor.php \Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor::setView()

Set the current view object.

Parameters

mixed $view: The current view object or NULL.

1 call to ViewsBulkOperationsActionProcessor::setView()
ViewsBulkOperationsActionProcessor::initialize in src/Service/ViewsBulkOperationsActionProcessor.php
Set values.

File

src/Service/ViewsBulkOperationsActionProcessor.php, line 167

Class

ViewsBulkOperationsActionProcessor
Defines VBO action processor.

Namespace

Drupal\views_bulk_operations\Service

Code

protected function setView($view = NULL) {
  if (!is_null($view)) {
    $this->view = $view;
  }
  else {
    $this->view = Views::getView($this->bulkFormData['view_id']);
    $this->view
      ->setDisplay($this->bulkFormData['display_id']);
    if (!empty($this->bulkFormData['arguments'])) {
      $this->view
        ->setArguments($this->bulkFormData['arguments']);
    }
    if (!empty($this->bulkFormData['exposed_input'])) {
      $this->view
        ->setExposedInput($this->bulkFormData['exposed_input']);
    }
  }
}