function view::copy

3.x view.inc view::copy()
2.x view.inc view::copy()

Make a copy of this view that has been sanitized of all database IDs and handlers and other stuff.

I'd call this clone() but it's reserved.

File

includes/view.inc, line 1558
view.inc Provides the view object type and associated methods.

Class

view
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.

Code

function copy() {
  $code = $this->export();
  eval($code);
  return $view;
}