You are here

function _field_encrypt_define_entity_hooks in Field Encryption 3.0.x

Creates entity hooks for entity types with encrypted fields.

Parameters

string $entity_type_id: (optional) The entity type to create hooks for. If omitted hooks will be registered for all entity types with encrypted fields.

See also

field_encrypt_module_implements_alter()

2 calls to _field_encrypt_define_entity_hooks()
DynamicEntityHooksTest::testDynamicFunctionRegistration in tests/src/Kernel/DynamicEntityHooksTest.php
Tests _field_encrypt_define_entity_hooks().
field_encrypt_module_implements_alter in ./field_encrypt.module
Implements hook_module_implements_alter().

File

./field_encrypt.module, line 339
Contains module hooks for field_encrypt.

Code

function _field_encrypt_define_entity_hooks($entity_type_id = NULL) {
  if (!_field_encrypt_can_eval()) {
    return;
  }
  $functions = _field_encrypt_entity_hooks($entity_type_id);
  if ($functions) {

    // Register entity hooks.
    // phpcs:disable Drupal.Functions.DiscouragedFunctions.Discouraged
    eval($functions);

    // phpcs:enable
  }
}