You are here

function opigno_certificate_entity_field_storage_info in Opigno certificate 8

Same name and namespace in other branches
  1. 3.x opigno_certificate.module \opigno_certificate_entity_field_storage_info()

Implements hook_entity_field_storage_info().

File

./opigno_certificate.module, line 112
Contains opigno_certificate.module.

Code

function opigno_certificate_entity_field_storage_info(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->id() == 'opigno_certificate') {
    $fields['body'] = FieldStorageDefinition::create('text_long')
      ->setLabel(t('Body'))
      ->setName('body')
      ->setTargetEntityTypeId($entity_type
      ->id());
    $fields['view_mode'] = FieldStorageDefinition::create('view_mode_selector')
      ->setLabel(t('View mode'))
      ->setName('view_mode')
      ->setTargetEntityTypeId($entity_type
      ->id());
    return $fields;
  }
}