You are here

class SocialContentBlockLandingPageConfigOverride in Open Social 10.0.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_content_block/modules/social_content_block_landing_page/src/SocialContentBlockLandingPageConfigOverride.php \Drupal\social_content_block_landing_page\SocialContentBlockLandingPageConfigOverride
  2. 10.3.x modules/social_features/social_content_block/modules/social_content_block_landing_page/src/SocialContentBlockLandingPageConfigOverride.php \Drupal\social_content_block_landing_page\SocialContentBlockLandingPageConfigOverride
  3. 10.1.x modules/social_features/social_content_block/modules/social_content_block_landing_page/src/SocialContentBlockLandingPageConfigOverride.php \Drupal\social_content_block_landing_page\SocialContentBlockLandingPageConfigOverride
  4. 10.2.x modules/social_features/social_content_block/modules/social_content_block_landing_page/src/SocialContentBlockLandingPageConfigOverride.php \Drupal\social_content_block_landing_page\SocialContentBlockLandingPageConfigOverride

Class SocialContentBlockLandingPageConfigOverride.

@package Drupal\social_content_block_landing_page

Hierarchy

Expanded class hierarchy of SocialContentBlockLandingPageConfigOverride

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

File

modules/social_features/social_content_block/modules/social_content_block_landing_page/src/SocialContentBlockLandingPageConfigOverride.php, line 15

Namespace

Drupal\social_content_block_landing_page
View source
class SocialContentBlockLandingPageConfigOverride implements ConfigFactoryOverrideInterface {

  /**
   * The configuration factory.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $configFactory;

  /**
   * Constructs the configuration override.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The configuration factory.
   */
  public function __construct(ConfigFactoryInterface $config_factory) {
    $this->configFactory = $config_factory;
  }

  /**
   * {@inheritdoc}
   */
  public function loadOverrides($names) {
    $overrides = [];
    $config_name = 'field.field.paragraph.section.field_section_paragraph';
    if (in_array($config_name, $names)) {
      $dependencies = $this->configFactory
        ->getEditable($config_name)
        ->get('dependencies.config');
      $dependencies[] = 'paragraphs.paragraphs_type.custom_content_list';
      $overrides[$config_name] = [
        'dependencies' => [
          'config' => $dependencies,
        ],
        'settings' => [
          'handler_settings' => [
            'target_bundles' => [
              'custom_content_list' => 'custom_content_list',
            ],
            'target_bundles_drag_drop' => [
              'custom_content_list' => [
                'enabled' => TRUE,
                'weight' => 17,
              ],
            ],
          ],
        ],
      ];
    }
    return $overrides;
  }

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

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