public function LingotekFakeConfigFactory::getEditable in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 4.0.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::getEditable()
- 3.3.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::getEditable()
- 3.4.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::getEditable()
- 3.5.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::getEditable()
- 3.6.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::getEditable()
- 3.8.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::getEditable()
Returns a mutable configuration object for a given name.
Should not be used for config that will have runtime effects. Therefore it is always loaded override free.
Parameters
string $name: The name of the configuration object to construct.
Return value
\Drupal\Core\Config\Config A configuration object.
Overrides ConfigFactory::getEditable
File
- tests/
modules/ lingotek_test/ src/ LingotekFakeConfigFactory.php, line 28
Class
Namespace
Drupal\lingotek_testCode
public function getEditable($name) {
$config = parent::getEditable($name);
if ($name === 'lingotek.settings') {
if ($config instanceof LingotekFakeConfigWrapper && $config->config instanceof ImmutableConfig) {
unset($this->cache[$name]);
$config = parent::getEditable($name);
$config = new LingotekFakeConfigWrapper($name, $this->storage, $this->eventDispatcher, $this->typedConfigManager, $config);
$this->cache[$name] = $config;
}
elseif (!$config instanceof LingotekFakeConfigWrapper) {
$config = new LingotekFakeConfigWrapper($name, $this->storage, $this->eventDispatcher, $this->typedConfigManager, $config);
$this->cache[$name] = $config;
}
}
return $config;
}