function Schema::createTableFromDefinition

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Database/Schema.php \Drupal\Core\Database\Schema::createTableFromDefinition()

Creates a new table from a table schema definition.

Parameters

\Drupal\Core\Database\SchemaDefinition\SchemaDefinitionType $schemaDefinitionType: The type of Drupal feature providing the schema.

string $schemaName: The schema name.

\Drupal\Core\Database\SchemaDefinition\Table $table: The table definition.

Throws

\Drupal\Core\Database\SchemaObjectExistsException If the specified table already exists.

\BadMethodCallException When concrete driver class is missing implementations.

1 call to Schema::createTableFromDefinition()
Schema::createSchemaFromDefinition in core/lib/Drupal/Core/Database/Schema.php
Creates the tables in a schema definition.

File

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

Class

Schema
Provides a base implementation for Database Schema.

Namespace

Drupal\Core\Database

Code

final public function createTableFromDefinition(SchemaDefinitionType $schemaDefinitionType, string $schemaName, TableDefinition $table) : void {
  $this->createTable($table->name, $table->toArray());
}

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