function db_find_tables

Same name in other branches
  1. 7.x includes/database/database.inc \db_find_tables()

Finds all tables that are like the specified base table name.

Parameters

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

Return value

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

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call findTables() on it. For example, $injected_database->schema()->findTables($table_expression);

See also

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

\Drupal\Core\Database\Schema::findTables()

Related topics

1 call to db_find_tables()
DatabaseLegacyTest::testDbFindTables in core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php
Tests the db_find_tables() function.

File

core/includes/database.inc, line 748

Code

function db_find_tables($table_expression) {
    @trigger_error('db_find_tables() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Use $injected_database->schema()->findTables($table_expression) instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
    return Database::getConnection()->schema()
        ->findTables($table_expression);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.