You are here

protected function CommerceContentEntityStorage::getEventName in Commerce Core 8.2

Gets the event name for the given hook.

Created using the entity type's module name and ID. For example, the 'presave' hook for commerce_order_item entities maps to the 'commerce_order.commerce_order_item.presave' event name.

Parameters

string $hook: One of 'load', 'create', 'presave', 'insert', 'update', 'predelete', 'delete', 'translation_insert', 'translation_delete'.

Return value

string The event name.

2 calls to CommerceContentEntityStorage::getEventName()
CommerceContentEntityStorage::invokeHook in src/CommerceContentEntityStorage.php
Invokes a hook on behalf of the entity.
CommerceContentEntityStorage::postLoad in src/CommerceContentEntityStorage.php
Attaches data to entities upon loading.

File

src/CommerceContentEntityStorage.php, line 122

Class

CommerceContentEntityStorage
The default Commerce storage for content entities.

Namespace

Drupal\commerce

Code

protected function getEventName($hook) {
  return $this->entityType
    ->getProvider() . '.' . $this->entityType
    ->id() . '.' . $hook;
}