You are here

public function ViewStorage::getExecutable in Views (for Drupal 7) 8.3

Retrieves the executable version of this view.

Parameters

bool $reset: Get a new Drupal\views\ViewExecutable instance.

bool $ui: If this should return Drupal\views_ui\ViewUI instead.

Return value

Drupal\views\ViewExecutable The executable version of this view.

File

lib/Drupal/views/ViewStorage.php, line 139
Definition of Drupal\views\ViewStorage.

Class

ViewStorage
Defines a ViewStorage configuration entity class.

Namespace

Drupal\views

Code

public function getExecutable($reset = FALSE, $ui = FALSE) {
  if (!isset($this->executable) || $reset) {

    // @todo Remove this approach and use proper dependency injection.
    if ($ui) {
      $executable = new ViewUI($this);
    }
    else {
      $executable = new ViewExecutable($this);
    }
    $this
      ->setExecutable($executable);
  }
  return $this->executable;
}