protected function Schema::buildTableNameCondition in Drupal 9
Same name in this branch
- 9 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::buildTableNameCondition()
- 9 core/lib/Drupal/Core/Database/Driver/mysql/Schema.php \Drupal\Core\Database\Driver\mysql\Schema::buildTableNameCondition()
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Database/Driver/mysql/Schema.php \Drupal\Core\Database\Driver\mysql\Schema::buildTableNameCondition()
Build a condition to match a table name against a standard information_schema.
MySQL uses databases like schemas rather than catalogs so when we build a condition to query the information_schema.tables, we set the default database as the schema unless specified otherwise, and exclude table_catalog from the condition criteria.
Overrides Schema::buildTableNameCondition
1 call to Schema::buildTableNameCondition()
- Schema::getComment in core/
lib/ Drupal/ Core/ Database/ Driver/ mysql/ Schema.php - Retrieve a table or column comment.
File
- core/
lib/ Drupal/ Core/ Database/ Driver/ mysql/ Schema.php, line 74
Class
- Schema
- MySQL implementation of \Drupal\Core\Database\Schema.
Namespace
Drupal\Core\Database\Driver\mysqlCode
protected function buildTableNameCondition($table_name, $operator = '=', $add_prefix = TRUE) {
$table_info = $this
->getPrefixInfo($table_name, $add_prefix);
$condition = $this->connection
->condition('AND');
$condition
->condition('table_schema', $table_info['database']);
$condition
->condition('table_name', $table_info['table'], $operator);
return $condition;
}