You are here

class LingotekFakeConfigFactory in Lingotek Translation 3.8.x

Same name and namespace in other branches
  1. 4.0.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory
  2. 3.3.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory
  3. 3.4.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory
  4. 3.5.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory
  5. 3.6.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory
  6. 3.7.x tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php \Drupal\lingotek_test\LingotekFakeConfigFactory

Hierarchy

Expanded class hierarchy of LingotekFakeConfigFactory

File

tests/modules/lingotek_test/src/LingotekFakeConfigFactory.php, line 9

Namespace

Drupal\lingotek_test
View source
class LingotekFakeConfigFactory extends ConfigFactory implements ConfigFactoryInterface {
  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;
  }
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigFactory::$cache protected property Cached configuration objects.
ConfigFactory::$configFactoryOverrides protected property An array of config factory override objects ordered by priority.
ConfigFactory::$eventDispatcher protected property An event dispatcher instance to use for configuration events.
ConfigFactory::$storage protected property A storage instance for reading and writing configuration data.
ConfigFactory::$typedConfigManager protected property The typed config manager.
ConfigFactory::addOverride public function Adds config factory override services. Overrides ConfigFactoryInterface::addOverride
ConfigFactory::clearStaticCache public function Clears the config factory static cache. Overrides ConfigFactoryInterface::clearStaticCache
ConfigFactory::createConfigObject protected function Creates a configuration object.
ConfigFactory::doGet protected function Returns a configuration object for a given name.
ConfigFactory::doLoadMultiple protected function Returns a list of configuration objects for the given names.
ConfigFactory::getCacheKeys public function The cache keys associated with the state of the config factory. Overrides ConfigFactoryInterface::getCacheKeys
ConfigFactory::getConfigCacheKey protected function Gets the static cache key for a given config name.
ConfigFactory::getConfigCacheKeys protected function Gets all the cache keys that match the provided config name.
ConfigFactory::getSubscribedEvents public static function
ConfigFactory::listAll public function Gets configuration object names starting with a given prefix. Overrides ConfigFactoryInterface::listAll
ConfigFactory::loadMultiple public function Returns a list of configuration objects for the given names. Overrides ConfigFactoryInterface::loadMultiple
ConfigFactory::loadOverrides protected function Get arbitrary overrides for the named configuration objects from modules.
ConfigFactory::onConfigDelete public function Removes stale static cache entries when configuration is deleted.
ConfigFactory::onConfigSave public function Updates stale static cache entries when configuration is saved.
ConfigFactory::propagateConfigOverrideCacheability protected function Propagates cacheability of config overrides to cached config objects.
ConfigFactory::rename public function Renames a configuration object using the storage. Overrides ConfigFactoryInterface::rename
ConfigFactory::reset public function Resets and re-initializes configuration objects. Internal use only. Overrides ConfigFactoryInterface::reset
ConfigFactory::__construct public function Constructs the Config factory.
LingotekFakeConfigFactory::get public function Returns an immutable configuration object for a given name. Overrides ConfigFactory::get
LingotekFakeConfigFactory::getEditable public function Returns a mutable configuration object for a given name. Overrides ConfigFactory::getEditable