function _entity_test_record_hooks

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/entity_test.module \_entity_test_record_hooks()
  2. 10 core/modules/system/tests/modules/entity_test/entity_test.module \_entity_test_record_hooks()
  3. 11.x core/modules/system/tests/modules/entity_test/entity_test.module \_entity_test_record_hooks()

Helper function to be used to record hook invocations.

Parameters

string $hook: The hook name.

mixed $data: Arbitrary data associated with the hook invocation.

20 calls to _entity_test_record_hooks()
entity_test_entity_revision_create in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_entity_revision_create().
entity_test_entity_test_mulrev_changed_translation_create in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_translation_create() for 'entity_test_mulrev_changed'.
entity_test_entity_test_mulrev_changed_translation_delete in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_translation_delete().
entity_test_entity_test_mulrev_changed_translation_insert in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_translation_insert() for 'entity_test_mulrev'.
entity_test_entity_test_mulrev_revision_create in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_revision_create() for 'entity_test_mulrev'.

... See full list

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 767

Code

function _entity_test_record_hooks($hook, $data) {
    $state = \Drupal::state();
    $key = 'entity_test.hooks';
    $hooks = $state->get($key);
    $hooks[$hook] = $data;
    $state->set($key, $hooks);
}

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