You are here

class SocialLikeConfigOverride in Open Social 10.0.x

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

Class SocialLikeConfigOverride.

Example configuration override.

@package Drupal\social_like

Hierarchy

Expanded class hierarchy of SocialLikeConfigOverride

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

File

modules/social_features/social_like/src/SocialLikeConfigOverride.php, line 16

Namespace

Drupal\social_like
View source
class SocialLikeConfigOverride implements ConfigFactoryOverrideInterface {

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

    // Override post photo default.
    $config_names = [
      'core.entity_view_display.post.photo.activity',
      'core.entity_view_display.post.photo.default',
    ];
    foreach ($config_names as $config_name) {
      if (in_array($config_name, $names)) {
        $overrides[$config_name] = [
          'content' => [
            'like_and_dislike' => [
              'weight' => 2,
              'settings' => [],
              'third_party_settings' => [],
            ],
          ],
        ];
      }
    }
    return $overrides;
  }

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

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