You are here

function _social_mentions_set_default_config in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  2. 8 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  3. 8.2 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  4. 8.4 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  5. 8.5 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  6. 8.6 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  7. 8.7 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  8. 8.8 modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  9. 10.3.x modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  10. 10.0.x modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  11. 10.1.x modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()
  12. 10.2.x modules/social_features/social_mentions/social_mentions.install \_social_mentions_set_default_config()

Set default settings.

1 call to _social_mentions_set_default_config()
social_mentions_install in modules/social_features/social_mentions/social_mentions.install
Implements hook_install().

File

modules/social_features/social_mentions/social_mentions.install, line 76
Install, update and uninstall functions for the social_mentions module.

Code

function _social_mentions_set_default_config() {
  $config = \Drupal::configFactory()
    ->getEditable('mentions.settings');
  $allowed_entity_types = [
    'post',
    'comment',
  ];
  $allowed_entity_types = array_combine($allowed_entity_types, $allowed_entity_types);
  $config
    ->set('supported_entity_types', $allowed_entity_types);
  $config
    ->set('suggestions_format', SOCIAL_PROFILE_SUGGESTIONS_ALL);
  $config
    ->set('suggestions_amount', 8);
  $config
    ->save();
}