function field_encrypt_test_entity_base_field_info in Field Encryption 3.0.x
Implements hook_entity_base_field_info().
File
- tests/
modules/ field_encrypt_test/ field_encrypt_test.module, line 65 - Contains module hooks for field_encrypt_test.
Code
function field_encrypt_test_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type
->id() === 'node' && \Drupal::state()
->get('field_encrypt.create_base_field', FALSE)) {
$fields['field_encrypt_test_base_field'] = BaseFieldDefinition::create('string')
->setLabel('Field Encrypt test base field');
}
return $fields;
}