function NodeStorageSchema::getEntitySchema

Same name in other branches
  1. 9 core/modules/node/src/NodeStorageSchema.php \Drupal\node\NodeStorageSchema::getEntitySchema()
  2. 8.9.x core/modules/node/src/NodeStorageSchema.php \Drupal\node\NodeStorageSchema::getEntitySchema()
  3. 10 core/modules/node/src/NodeStorageSchema.php \Drupal\node\NodeStorageSchema::getEntitySchema()

Overrides SqlContentEntityStorageSchema::getEntitySchema

File

core/modules/node/src/NodeStorageSchema.php, line 17

Class

NodeStorageSchema
Defines the node schema handler.

Namespace

Drupal\node

Code

protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
    $schema = parent::getEntitySchema($entity_type, $reset);
    if ($data_table = $this->storage
        ->getDataTable()) {
        $schema[$data_table]['indexes'] += [
            'node__frontpage' => [
                'promote',
                'status',
                'sticky',
                'created',
            ],
            'node__title_type' => [
                'title',
                [
                    'type',
                    4,
                ],
            ],
        ];
    }
    return $schema;
}

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