You are here

function social_profile_entity_base_field_info in Open Social 10.3.x

Same name and namespace in other branches
  1. 10.2.x modules/social_features/social_profile/social_profile.module \social_profile_entity_base_field_info()

Implements hook_entity_base_field_info().

File

modules/social_features/social_profile/social_profile.module, line 944
The Social profile module.

Code

function social_profile_entity_base_field_info(EntityTypeInterface $entity_type) {
  $fields = [];

  // Check if we're dealing with the profile entity.
  if ($entity_type
    ->id() === 'profile') {
    $fields['profile_name'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Profile name'))
      ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
      ->setReadOnly(TRUE);
  }
  return $fields;
}