You are here

function comment_update_8301 in Drupal 8

Set the 'published' entity key.

File

core/modules/comment/comment.install, line 206
Install, update and uninstall functions for the Comment module.

Code

function comment_update_8301() {
  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  $entity_type = $definition_update_manager
    ->getEntityType('comment');
  $keys = $entity_type
    ->getKeys();
  $keys['published'] = 'status';
  $entity_type
    ->set('entity_keys', $keys);
  $definition_update_manager
    ->updateEntityType($entity_type);
}