You are here

function db_find_tables_d8 in Drupal 7

Finds all tables that are like the specified base table name. This is a backport of the change made to db_find_tables in Drupal 8 to work with virtual, un-prefixed table names. The original function is retained for Backwards Compatibility.

Parameters

$table_expression: An SQL expression, for example "simpletest%" (without the quotes).

Return value

Array, both the keys and the values are the matching tables.

See also

https://www.drupal.org/node/2552435

Related topics

3 calls to db_find_tables_d8()
DrupalWebTestCase::tearDown in modules/simpletest/drupal_web_test_case.php
Delete created files and temporary files directory, delete the tables created by setUp(), and reset the database prefix.
ModuleTestCase::assertTableCount in modules/system/system.test
Assert there are tables that begin with the specified base table name.
simpletest_clean_database in modules/simpletest/simpletest.module
Removed prefixed tables from the database that are left over from crashed tests.

File

includes/database/database.inc, line 2915
Core systems for the database layer.

Code

function db_find_tables_d8($table_expression) {
  return Database::getConnection()
    ->schema()
    ->findTablesD8($table_expression);
}