You are here

function taxonomy_machine_name_entity_base_field_info in Taxonomy Machine Name 8

Implements hook_entity_base_field_info().

File

./taxonomy_machine_name.module, line 22
This is the Taxonomy Machine Name module.

Code

function taxonomy_machine_name_entity_base_field_info(EntityTypeInterface $entity_type) {
  $fields = [];
  if ($entity_type
    ->id() == 'taxonomy_term') {
    $fields['machine_name'] = BaseFieldDefinition::create('string')
      ->setLabel('Machine name')
      ->setDescription('Machine name for internal use.')
      ->setRevisionable(FALSE);
  }
  return $fields;
}