function commerce_pricelist_update_8202 in Commerce Pricelist 8.2
Define event handlers for price list and price list items.
File
- ./
commerce_pricelist.install, line 64 - Install, update and uninstall functions for the Pricelist module.
Code
function commerce_pricelist_update_8202() {
$definition_update_manager = \Drupal::entityDefinitionUpdateManager();
$entity_type = $definition_update_manager
->getEntityType('commerce_pricelist');
$entity_type
->setHandlerClass('event', PriceListEvent::class);
$entity_type
->setHandlerClass('storage', CommerceContentEntityStorage::class);
$definition_update_manager
->updateEntityType($entity_type);
$entity_type = $definition_update_manager
->getEntityType('commerce_pricelist_item');
$entity_type
->setHandlerClass('event', PriceListItemEvent::class);
$entity_type
->setHandlerClass('storage', CommerceContentEntityStorage::class);
$definition_update_manager
->updateEntityType($entity_type);
}