You are here

public function RestrictedNameProcessorOverride::loadOverrides in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php \Drupal\social_profile_privacy\RestrictedNameProcessorOverride::loadOverrides()
  2. 8.7 modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php \Drupal\social_profile_privacy\RestrictedNameProcessorOverride::loadOverrides()
  3. 8.8 modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php \Drupal\social_profile_privacy\RestrictedNameProcessorOverride::loadOverrides()
  4. 10.3.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php \Drupal\social_profile_privacy\RestrictedNameProcessorOverride::loadOverrides()
  5. 10.0.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php \Drupal\social_profile_privacy\RestrictedNameProcessorOverride::loadOverrides()
  6. 10.2.x modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php \Drupal\social_profile_privacy\RestrictedNameProcessorOverride::loadOverrides()

Load overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/social_features/social_profile/modules/social_profile_privacy/src/RestrictedNameProcessorOverride.php, line 19

Class

RestrictedNameProcessorOverride
Adds the Restricted Name field to our required processors.

Namespace

Drupal\social_profile_privacy

Code

public function loadOverrides($names) {
  $overrides = [];

  // Set processor settings for social all and users.
  $config_names = [
    'search_api.index.social_all',
    'search_api.index.social_users',
  ];
  foreach ($config_names as $config_name) {
    if (in_array($config_name, $names, TRUE)) {
      $overrides[$config_name] = [
        'processor_settings' => [
          'tokenizer' => [
            'fields' => [
              'social_profile_privacy_restricted_name' => 'social_profile_privacy_restricted_name',
            ],
          ],
          'ignorecase' => [
            'fields' => [
              'social_profile_privacy_restricted_name' => 'social_profile_privacy_restricted_name',
            ],
          ],
          'transliteration' => [
            'fields' => [
              'social_profile_privacy_restricted_name' => 'social_profile_privacy_restricted_name',
            ],
          ],
        ],
      ];
    }
  }
  return $overrides;
}