public function LingotekFakeConfigFactory::get in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 4.0.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::get()
- 3.3.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::get()
- 3.4.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::get()
- 3.6.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::get()
- 3.7.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::get()
- 3.8.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory::get()
Returns an immutable configuration object for a given name.
Parameters
string $name: The name of the configuration object to construct.
Return value
\Drupal\Core\Config\ImmutableConfig A configuration object.
Overrides ConfigFactory::get
File
- tests/
modules/ lingotek_test/ src/ LingotekFakeConfigFactory.php, line 11
Class
Namespace
Drupal\lingotek_testCode
public function get($name) {
$config = parent::get($name);
if ($name === 'lingotek.settings') {
if ($config instanceof LingotekFakeConfigWrapper && !$config->config instanceof ImmutableConfig) {
unset($this->cache[$name]);
$config = parent::get($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;
}