You are here

function field_encrypt_entity_insert in Field Encryption 8.2

Same name and namespace in other branches
  1. 3.0.x field_encrypt.module \field_encrypt_entity_insert()

Implements hook_entity_insert().

Encrypts the entity after being saved for the first time.

File

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

Code

function field_encrypt_entity_insert(EntityInterface $entity) {
  if (field_encrypt_allow_encryption($entity)) {
    \Drupal::service('field_encrypt.encrypted_field_value_manager')
      ->saveEncryptedFieldValues($entity);
  }
}