You are here

function _views_delete_view in Views (for Drupal 7) 5

Delete a view from the database.

1 call to _views_delete_view()
views_ui_admin_delete_confirm_submit in ./views_ui.module

File

./views.module, line 882

Code

function _views_delete_view($view) {
  $view->vid = intval($view->vid);
  if (!$view->vid) {
    return;
  }
  db_query("DELETE FROM {view_view} where vid=%d", $view->vid);
  db_query("DELETE FROM {view_sort} where vid=%d", $view->vid);
  db_query("DELETE FROM {view_argument} where vid=%d", $view->vid);
  db_query("DELETE FROM {view_tablefield} where vid=%d", $view->vid);
  db_query("DELETE FROM {view_filter} where vid=%d", $view->vid);
  db_query("DELETE FROM {view_exposed_filter} where vid=%d", $view->vid);
  cache_clear_all('views_query:' . $view->name, 'cache_views');
  cache_clear_all();

  // In Drupal 5.0 and later this clears the page cache only.
}