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

18 calls to db_table_exists()
Block::updateBlockBid in drupal/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php
Update the block delta when you change the machine readable name of the display.
DatabaseTestBase::installTables in drupal/core/modules/system/lib/Drupal/system/Tests/Database/DatabaseTestBase.php
Sets up several tables needed by a certain test.
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().

... 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);
}