You are here

function social_simple_per_node_entity_base_field_info in Social simple 8

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

Implements hook_entity_base_field_info().

File

modules/social_simple_per_node/social_simple_per_node.module, line 32
Contains social.module..

Code

function social_simple_per_node_entity_base_field_info(EntityTypeInterface $entity_type) {
  $fields = [];
  if ($entity_type
    ->id() === 'node') {
    $fields['social_share'] = BaseFieldDefinition::create('boolean')
      ->setLabel(t('Social share links'))
      ->setName('social_share')
      ->setRevisionable(TRUE)
      ->setTranslatable(TRUE)
      ->setDescription(t('Stores whether the social share links are displayed or not.'))
      ->setDefaultValue(TRUE);
  }
  return $fields;
}