You are here

protected function Sql::getFieldSchema in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/id_map/Sql.php \Drupal\migrate\Plugin\migrate\id_map\Sql::getFieldSchema()

Create schema from an id definition.

Parameters

array $id_definition: A field schema definition. Can be SQL schema or a type data based schema. In the latter case, the value of type needs to be $typed_data_type.$column

Return value

array

1 call to Sql::getFieldSchema()
Sql::ensureTables in core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
Create the map and message tables if they don't already exist.
1 method overrides Sql::getFieldSchema()
TestSqlIdMap::getFieldSchema in core/modules/migrate/tests/src/Unit/TestSqlIdMap.php
Creates schema from an ID definition.

File

core/modules/migrate/src/Plugin/migrate/id_map/Sql.php, line 416
Contains \Drupal\migrate\Plugin\migrate\id_map\Sql.

Class

Sql
Defines the sql based ID map implementation.

Namespace

Drupal\migrate\Plugin\migrate\id_map

Code

protected function getFieldSchema(array $id_definition) {
  $type_parts = explode('.', $id_definition['type']);
  if (count($type_parts) == 1) {
    $type_parts[] = 'value';
  }
  $schema = BaseFieldDefinition::create($type_parts[0])
    ->getColumns();
  return $schema[$type_parts[1]];
}