You are here

function commerce_product_update_8202 in Commerce Core 8.2

Set the 'published' entity key.

File

modules/product/commerce_product.install, line 41
Install, update and uninstall functions for the Product module.

Code

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