You are here

public function ConfigBit::configSave in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.8

Same name and namespace in other branches
  1. 9.0.x src/Config/ConfigBit.php \Drupal\varbase\Config\ConfigBit::configSave()

React to a config object being saved.

Parameters

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

File

src/Config/ConfigBit.php, line 174

Class

ConfigBit
Class ConfigBit.

Namespace

Drupal\varbase\Config

Code

public function configSave(ConfigCrudEvent $event) {
  $saved_config = $event
    ->getConfig();
  $saved_config_name = $saved_config
    ->getName();
  $supportedConfigTypes = $this
    ->supportedConfigTypes();

  // Process config bits for each supported config type.
  foreach ($supportedConfigTypes as $supportedConfigType) {
    if (preg_match($supportedConfigType['config_name_match'], $saved_config_name)) {
      $this
        ->processConfigBits($supportedConfigType, $saved_config);
    }
  }
}