You are here

private function SocialTaggingOverrides::shouldApplyOverrides in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_tagging/src/SocialTaggingOverrides.php \Drupal\social_tagging\SocialTaggingOverrides::shouldApplyOverrides()
  2. 8.8 modules/social_features/social_tagging/src/SocialTaggingOverrides.php \Drupal\social_tagging\SocialTaggingOverrides::shouldApplyOverrides()
  3. 10.3.x modules/social_features/social_tagging/src/SocialTaggingOverrides.php \Drupal\social_tagging\SocialTaggingOverrides::shouldApplyOverrides()
  4. 10.0.x modules/social_features/social_tagging/src/SocialTaggingOverrides.php \Drupal\social_tagging\SocialTaggingOverrides::shouldApplyOverrides()
  5. 10.1.x modules/social_features/social_tagging/src/SocialTaggingOverrides.php \Drupal\social_tagging\SocialTaggingOverrides::shouldApplyOverrides()
  6. 10.2.x modules/social_features/social_tagging/src/SocialTaggingOverrides.php \Drupal\social_tagging\SocialTaggingOverrides::shouldApplyOverrides()

Whether this config override should apply to the provided configurations.

Used to check what to return in loadOverrides as well as in the metadata method.

Parameters

array $names: The names of the configs for which overrides are being loaded.

Return value

bool Whether we override those configs.

2 calls to SocialTaggingOverrides::shouldApplyOverrides()
SocialTaggingOverrides::getCacheableMetadata in modules/social_features/social_tagging/src/SocialTaggingOverrides.php
Gets the cacheability metadata associated with the config factory override.
SocialTaggingOverrides::loadOverrides in modules/social_features/social_tagging/src/SocialTaggingOverrides.php
Returns config overrides.

File

modules/social_features/social_tagging/src/SocialTaggingOverrides.php, line 33

Class

SocialTaggingOverrides
Configuration override.

Namespace

Drupal\social_tagging

Code

private function shouldApplyOverrides(array $names) {
  $config_names = [
    'views.view.search_content',
    'views.view.search_groups',
    'search_api.index.social_content',
    'search_api.index.social_groups',
    'views.view.latest_topics',
    'views.view.upcoming_events',
    'views.view.topics',
    'views.view.events',
    'views.view.group_topics',
    'views.view.group_events',
    'views.view.newest_groups',
  ];

  // We loop over the provided names instead of the config names we override
  // which is slightly faster in the case of being called from
  // `getCacheableMetadata` which checks for a single config only.
  foreach ($names as $name) {
    if (in_array($name, $config_names)) {
      return TRUE;
    }
  }
  return FALSE;
}