You are here

function social_profile_update_8904 in Open Social 10.2.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_profile/social_profile.install \social_profile_update_8904()

Install Profile name field to profile entity type.

File

modules/social_features/social_profile/social_profile.install, line 501
Install, update and uninstall functions for the social_profile module.

Code

function social_profile_update_8904() {
  $field_storage_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Profile name'))
    ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
    ->setReadOnly(TRUE);
  $update_manager = \Drupal::entityDefinitionUpdateManager();
  $update_manager
    ->installFieldStorageDefinition('profile_name', 'profile', 'social_profile', $field_storage_definition);
}