You are here

class SocialGroupSelectorWidgetConfigOverride in Open Social 8

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

Class SocialGroupSelectorWidgetConfigOverride.

@package Drupal\social_group

Hierarchy

Expanded class hierarchy of SocialGroupSelectorWidgetConfigOverride

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

File

modules/social_features/social_group/src/SocialGroupSelectorWidgetConfigOverride.php, line 14

Namespace

Drupal\social_group
View source
class SocialGroupSelectorWidgetConfigOverride implements ConfigFactoryOverrideInterface {

  /**
   * Load overrides.
   */
  public function loadOverrides($names) {
    $overrides = [];
    $config_names = [
      'core.entity_form_display.node.event.default',
      'core.entity_form_display.node.topic.default',
    ];
    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $config = \Drupal::service('config.factory')
          ->getEditable($config_name);

        // Add the field to the content.
        $content = $config
          ->get('content');
        $content['groups'] = [];
        $content['groups']['type'] = 'social_group_selector_widget';
        $content['groups']['settings'] = [];
        $content['groups']['weight'] = 16;
        $content['groups']['region'] = 'content';
        $content['groups']['third_party_settings'] = [];
        $overrides[$config_name] = [
          'content' => $content,
        ];
      }
    }
    return $overrides;
  }

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

  /**
   * {@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
SocialGroupSelectorWidgetConfigOverride::createConfigObject public function Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface::createConfigObject
SocialGroupSelectorWidgetConfigOverride::getCacheableMetadata public function Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface::getCacheableMetadata
SocialGroupSelectorWidgetConfigOverride::getCacheSuffix public function The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface::getCacheSuffix
SocialGroupSelectorWidgetConfigOverride::loadOverrides public function Load overrides. Overrides ConfigFactoryOverrideInterface::loadOverrides