function Schema::prefixNonTable

Same name in other branches
  1. 9 core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::prefixNonTable()
  2. 8.9.x core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::prefixNonTable()
  3. 11.x core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::prefixNonTable()

Create names for indexes, primary keys and constraints.

This prevents using {} around non-table names like indexes and keys.

File

core/lib/Drupal/Core/Database/Schema.php, line 113

Class

Schema
Provides a base implementation for Database Schema.

Namespace

Drupal\Core\Database

Code

public function prefixNonTable($table) {
    $args = func_get_args();
    $info = $this->getPrefixInfo($table);
    $args[0] = $info['table'];
    return implode('_', $args);
}

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