db_truncate

  1. drupal
    1. 7
Versions
7 db_truncate($table, array $options = array())

Returns a new TruncateQuery object for the active database.

Parameters

$table The table from which to delete.

$options An array of options to control how the query operates.

Return value

TruncateQuery A new TruncateQuery object for this connection.

Related topics

▾ 3 functions call db_truncate()

DrupalDatabaseCache::clear in drupal/includes/cache.inc
Expire data from the cache. If called without arguments, expirable entries will be cleared from the cache_page and cache_block bins.
_menu_router_save in drupal/includes/menu.inc
Helper function to save data from menu_router_build() to the router table.
_update_cache_clear in drupal/modules/update/update.module
Invalidates cached data relating to update status.

Code

drupal/includes/database/database.inc, line 2366

<?php
function db_truncate($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  }
  return Database::getConnection($options['target'])->truncate($table, $options);
}
?>