You are here

public function ViewExecutable::cloneView in Views (for Drupal 7) 8.3

Safely clone a view.

This will completely wipe a view clean so it can be considered fresh.

Return value

Drupal\views\ViewExecutable The cloned view.

1 method overrides ViewExecutable::cloneView()
ViewUI::cloneView in views_ui/lib/Drupal/views_ui/ViewUI.php
Overrides Drupal\views\ViewExecutable::cloneView().

File

lib/Drupal/views/ViewExecutable.php, line 1820
Definition of Drupal\views\ViewExecutable.

Class

ViewExecutable
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Namespace

Drupal\views

Code

public function cloneView() {
  $storage = clone $this->storage;
  return $storage
    ->getExecutable(TRUE);
}