function Schema::_createKeySql

Same name in other branches
  1. 9 core/modules/pgsql/src/Driver/Database/pgsql/Schema.php \Drupal\pgsql\Driver\Database\pgsql\Schema::_createKeySql()
  2. 10 core/modules/pgsql/src/Driver/Database/pgsql/Schema.php \Drupal\pgsql\Driver\Database\pgsql\Schema::_createKeySql()
  3. 11.x core/modules/pgsql/src/Driver/Database/pgsql/Schema.php \Drupal\pgsql\Driver\Database\pgsql\Schema::_createKeySql()
1 call to Schema::_createKeySql()
Schema::_createIndexSql in core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php

File

core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php, line 459

Class

Schema
PostgreSQL implementation of \Drupal\Core\Database\Schema.

Namespace

Drupal\Core\Database\Driver\pgsql

Code

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

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