function CommentStorageSchema::getEntitySchema

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

Overrides SqlContentEntityStorageSchema::getEntitySchema

File

core/modules/comment/src/CommentStorageSchema.php, line 18

Class

CommentStorageSchema
Defines the comment schema handler.

Namespace

Drupal\comment

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'] += [
            'comment__status_pid' => [
                'pid',
                'status',
            ],
            'comment__num_new' => [
                'entity_id',
                'entity_type',
                'comment_type',
                'status',
                'created',
                'cid',
                'thread',
            ],
            'comment__entity_langcode' => [
                'entity_id',
                'entity_type',
                'comment_type',
                'default_langcode',
            ],
        ];
    }
    return $schema;
}

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