protected function Schema::createKeySql in Drupal 10
Same name in this branch
- 10 core/modules/sqlite/src/Driver/Database/sqlite/Schema.php \Drupal\sqlite\Driver\Database\sqlite\Schema::createKeySql()
- 10 core/modules/mysql/src/Driver/Database/mysql/Schema.php \Drupal\mysql\Driver\Database\mysql\Schema::createKeySql()
4 calls to Schema::createKeySql()
- Schema::addIndex in core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Schema.php - Add an index.
- Schema::addPrimaryKey in core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Schema.php - Add a primary key.
- Schema::addUniqueKey in core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Schema.php - Add a unique key.
- Schema::createKeysSql in core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Schema.php
File
- core/
modules/ mysql/ src/ Driver/ Database/ mysql/ Schema.php, line 363
Class
- Schema
- MySQL implementation of \Drupal\Core\Database\Schema.
Namespace
Drupal\mysql\Driver\Database\mysqlCode
protected function createKeySql($fields) {
$return = [];
foreach ($fields as $field) {
if (is_array($field)) {
$return[] = '`' . $field[0] . '`(' . $field[1] . ')';
}
else {
$return[] = '`' . $field . '`';
}
}
return implode(', ', $return);
}