function FieldStorageConfig::getSchema

Same name in other branches
  1. 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSchema()
  2. 8.9.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSchema()
  3. 10 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getSchema()

Overrides FieldStorageDefinitionInterface::getSchema

1 call to FieldStorageConfig::getSchema()
FieldStorageConfig::getColumns in core/modules/field/src/Entity/FieldStorageConfig.php

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 484

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public function getSchema() {
    if (!isset($this->schema)) {
        // Get the schema from the field item class.
        $class = $this->getFieldItemClass();
        $schema = $class::schema($this);
        // Fill in default values for optional entries.
        $schema += [
            'columns' => [],
            'unique keys' => [],
            'indexes' => [],
            'foreign keys' => [],
        ];
        // Merge custom indexes with those specified by the field type. Custom
        // indexes prevail.
        $schema['indexes'] = $this->indexes + $schema['indexes'];
        $this->schema = $schema;
    }
    return $this->schema;
}

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