protected function Schema::createKeySql

Same name in this branch
  1. 9.x drupal/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php \Drupal\Core\Database\Driver\mysql\Schema::createKeySql()
  2. 9.x drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php \Drupal\Core\Database\Driver\sqlite\Schema::createKeySql()
3 calls to Schema::createKeySql()
Schema::addIndex in drupal/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
Add an index.
Schema::addPrimaryKey in drupal/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
Add a primary key.
Schema::addUniqueKey in drupal/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
Add a unique key.

File

drupal/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php, line 285
Definition of Drupal\Core\Database\Driver\mysql\Schema

Class

Schema

Namespace

Drupal\Core\Database\Driver\mysql

Code

protected function createKeySql($fields) {
  $return = array();
  foreach ($fields as $field) {
    if (is_array($field)) {
      $return[] = '`' . $field[0] . '`(' . $field[1] . ')';
    }
    else {
      $return[] = '`' . $field . '`';
    }
  }
  return implode(', ', $return);
}