function db_table_exists

Checks if a table exists.

Parameters

$table: The name of the table in drupal (no prefixing).

Return value

TRUE if the given table exists, otherwise FALSE.

Related topics

19 calls to db_table_exists()
ContactUpgradePathTest::testContactUpgrade in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php
Tests upgrade of contact table to configuration entities.
DrupalUnitTestBaseTest::testEnableModulesInstall in drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
Tests expected installation behavior of enableModules().
DrupalUnitTestBaseTest::testInstallSchema in drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
Tests expected behavior of installSchema().
DrupalUnitTestBaseTest::testSetUp in drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
Tests expected behavior of setUp().
drupal_uninstall_schema in drupal/core/includes/schema.inc
Removes all tables defined in a module's hook_schema().

... See full list

File

drupal/core/includes/database.inc, line 633
Core systems for the database layer.

Code

function db_table_exists($table) {
  return Database::getConnection()
    ->schema()
    ->tableExists($table);
}