function EntityCrudHookTest::entityInsert

Implements hook_entity_insert().

Attributes

#[Hook('entity_insert')]

File

core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php, line 704

Class

EntityCrudHookTest
Tests entity CRUD via hooks.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function entityInsert(EntityInterface $entity) : void {
  $GLOBALS['entity_crud_hook_test'][] = 'entity_crud_hook_test_entity_insert called for type ' . $entity->getEntityTypeId();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.