function UserStorageSchema::getEntitySchema

Same name in other branches
  1. 8.9.x core/modules/user/src/UserStorageSchema.php \Drupal\user\UserStorageSchema::getEntitySchema()
  2. 10 core/modules/user/src/UserStorageSchema.php \Drupal\user\UserStorageSchema::getEntitySchema()
  3. 11.x core/modules/user/src/UserStorageSchema.php \Drupal\user\UserStorageSchema::getEntitySchema()

Overrides SqlContentEntityStorageSchema::getEntitySchema

File

core/modules/user/src/UserStorageSchema.php, line 17

Class

UserStorageSchema
Defines the user schema handler.

Namespace

Drupal\user

Code

protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
    $schema = parent::getEntitySchema($entity_type, $reset);
    if ($data_table = $this->storage
        ->getDataTable()) {
        $schema[$data_table]['unique keys'] += [
            'user__name' => [
                'name',
                'langcode',
            ],
        ];
    }
    return $schema;
}

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