class ConfigOverriderLowPriority

Same name in other branches
  1. 9 core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php \Drupal\config_override_test\ConfigOverriderLowPriority
  2. 8.9.x core/modules/config/tests/config_override_test/src/ConfigOverriderLowPriority.php \Drupal\config_override_test\ConfigOverriderLowPriority
  3. 10 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
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 14

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


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.