You are here

class SocialLandingPageConfigOverride in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  2. 8.2 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  3. 8.3 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  4. 8.4 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  5. 8.5 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  6. 8.6 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  7. 8.7 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  8. 8.8 modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  9. 10.3.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  10. 10.0.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  11. 10.1.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride
  12. 10.2.x modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php \Drupal\social_landing_page\SocialLandingPageConfigOverride

Class SocialLandingPageConfigOverride.

Example configuration override.

@package Drupal\social_landing_page

Hierarchy

Expanded class hierarchy of SocialLandingPageConfigOverride

2 string references to 'SocialLandingPageConfigOverride'
SocialLandingPageConfigOverride::getCacheSuffix in modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php
The string to append to the configuration static cache name.
social_landing_page.services.yml in modules/social_features/social_landing_page/social_landing_page.services.yml
modules/social_features/social_landing_page/social_landing_page.services.yml
1 service uses SocialLandingPageConfigOverride
social_landing_page.overrider in modules/social_features/social_landing_page/social_landing_page.services.yml
\Drupal\social_landing_page\SocialLandingPageConfigOverride

File

modules/social_features/social_landing_page/src/SocialLandingPageConfigOverride.php, line 15

Namespace

Drupal\social_landing_page
View source
class SocialLandingPageConfigOverride implements ConfigFactoryOverrideInterface {

  /**
   * Load overrides.
   */
  public function loadOverrides($names) {
    $overrides = [];

    // Set hero title block for book content type.
    $config_names = [
      'search_api.index.social_all',
      'search_api.index.social_content',
    ];
    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $config = \Drupal::service('config.factory')
          ->getEditable($config_name);
        $bundles = $config
          ->get('datasource_settings.entity:node.bundles.selected');
        $bundles[] = 'landing_page';
        $overrides[$config_name] = [
          'datasource_settings' => [
            'entity:node' => [
              'bundles' => [
                'selected' => $bundles,
              ],
            ],
          ],
        ];
      }
    }
    return $overrides;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return 'SocialLandingPageConfigOverride';
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata($name) {
    return new CacheableMetadata();
  }

  /**
   * {@inheritdoc}
   */
  public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SocialLandingPageConfigOverride::createConfigObject public function Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface::createConfigObject
SocialLandingPageConfigOverride::getCacheableMetadata public function Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface::getCacheableMetadata
SocialLandingPageConfigOverride::getCacheSuffix public function The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface::getCacheSuffix
SocialLandingPageConfigOverride::loadOverrides public function Load overrides. Overrides ConfigFactoryOverrideInterface::loadOverrides