function QueryFactory::onConfigSave

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php \Drupal\Core\Config\Entity\Query\QueryFactory::onConfigSave()
  2. 8.9.x core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php \Drupal\Core\Config\Entity\Query\QueryFactory::onConfigSave()
  3. 10 core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php \Drupal\Core\Config\Entity\Query\QueryFactory::onConfigSave()

Updates configuration entity in the key store.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The configuration event.

File

core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php, line 235

Class

QueryFactory
Provides a factory for creating entity query objects for the config backend.

Namespace

Drupal\Core\Config\Entity\Query

Code

public function onConfigSave(ConfigCrudEvent $event) {
    $saved_config = $event->getConfig();
    $entity_type_id = $this->configManager
        ->getEntityTypeIdByName($saved_config->getName());
    if ($entity_type_id) {
        $entity_type = $this->configManager
            ->getEntityTypeManager()
            ->getDefinition($entity_type_id);
        $this->updateConfigKeyStore($entity_type, $saved_config);
    }
}

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