function Schema::toArray

Converts the object to legacy array-based specifications.

@internal

Return value

array The legacy array-based specification.

Overrides SchemaDefinitionInterface::toArray

File

core/lib/Drupal/Core/Database/SchemaDefinition/Schema.php, line 87

Class

Schema
Describes a database schema as a collection of database objects.

Namespace

Drupal\Core\Database\SchemaDefinition

Code

public function toArray() : array {
  $spec = [];
  foreach ($this->tables as $table) {
    $spec[$table->name] = $table->toArray();
  }
  return $spec;
}

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