You are here

function hook_entity_postsave in Hook Post Action 8

Same name and namespace in other branches
  1. 7 hook_post_action.api.php \hook_entity_postsave()

Gets called after an entity has been inserted/updated/deleted to database.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An entity object.

string $op: An string containing the operating that's taking place (insert/update/delete)

See also

hook_entity_postinsert()

hook_entity_postupdate()

hook_entity_postdelete()

1 invocation of hook_entity_postsave()
_hook_post_action_post_save in ./hook_post_action.module
Post save shutdown callback.

File

./hook_post_action.api.php, line 24
Documents API functions for hook_post_action module.

Code

function hook_entity_postsave(EntityInterface $entity, $op) {
  $id = $entity
    ->id();
  $entity_type = $entity
    ->getEntityTypeId();
  \Drupal::logger('hook_post_action_test')
    ->info('The @op entity @entity_type id is @id from @function.', [
    '@op' => t($op . 'd'),
    '@id' => $id,
    '@function' => __FUNCTION__,
    '@entity_type' => $entity_type,
  ]);
}