You are here

function toc_js_per_node_entity_base_field_info in Toc.js 8

Same name and namespace in other branches
  1. 2.0.x modules/toc_js_per_node/toc_js_per_node.module \toc_js_per_node_entity_base_field_info()

Implements hook_entity_base_field_info().

File

modules/toc_js_per_node/toc_js_per_node.module, line 102
Contains toc_js_per_node.module.

Code

function toc_js_per_node_entity_base_field_info(EntityTypeInterface $entity_type) {
  $fields = [];
  if ($entity_type
    ->id() === 'node') {
    $fields['toc_js_active'] = BaseFieldDefinition::create('boolean')
      ->setLabel(t('Toc active'))
      ->setName('toc_js_active')
      ->setRevisionable(TRUE)
      ->setTranslatable(TRUE)
      ->setDescription(t('Stores whether the Toc is displayed or not.'))
      ->setDefaultValue(TRUE);
  }
  return $fields;
}