You are here

public function WysiwygConfiguration::saveToActiveStore in Configuration Management 7.2

Implements Drupal\configuration\Config\Configuration::saveToActiveStore().

Overrides Configuration::saveToActiveStore

File

lib/Drupal/configuration/Config/WysiwygConfiguration.php, line 115
Definition of Drupal\configuration\Config\WysiwygConfiguration.

Class

WysiwygConfiguration

Namespace

Drupal\configuration\Config

Code

public function saveToActiveStore(ConfigIteratorSettings &$settings) {
  $profile = $this
    ->getData();

  // For profiles that doens't have editors assigned, provide a default
  // object to avoid sql exceptions.
  if (empty($profile)) {
    $profile = new \StdClass();
    $profile->editor = '';
    $profile->format = $this
      ->getIdentifier();
    $profile->settings = array();
  }
  db_merge('wysiwyg')
    ->key(array(
    'format' => $profile->format,
  ))
    ->fields(array(
    'format' => $profile->format,
    'editor' => $profile->editor,
    'settings' => serialize($profile->settings),
  ))
    ->execute();
  wysiwyg_profile_cache_clear();
  $settings
    ->addInfo('imported', $this
    ->getUniqueId());
}