You are here

class ConfigOverriderLowPriority in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php \Drupal\config_override_test\ConfigOverriderLowPriority

Tests module overrides for configuration.

Hierarchy

Expanded class hierarchy of ConfigOverriderLowPriority

2 string references to 'ConfigOverriderLowPriority'
ConfigOverriderLowPriority::getCacheSuffix in core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php
The string to append to the configuration static cache name.
config_override_test.services.yml in core/modules/config/tests/config_override_test/config_override_test.services.yml
core/modules/config/tests/config_override_test/config_override_test.services.yml
1 service uses ConfigOverriderLowPriority
config_override_test.low_priority_overrider in core/modules/config/tests/config_override_test/config_override_test.services.yml
Drupal\config_override_test\ConfigOverriderLowPriority

File

core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php, line 12

Namespace

Drupal\config_override_test
View source
class ConfigOverriderLowPriority implements ConfigFactoryOverrideInterface {

  /**
   * {@inheritdoc}
   */
  public function loadOverrides($names) {
    $overrides = [];
    if (!empty($GLOBALS['config_test_run_module_overrides'])) {
      if (in_array('system.site', $names)) {
        $overrides = [
          'system.site' => [
            'name' => 'Should not apply because of higher priority listener',
            // This override should apply because it is not overridden by the
            // higher priority listener.
            'slogan' => 'Yay for overrides!',
          ],
        ];
      }
    }
    return $overrides;
  }

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

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

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

}

Members

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