/**
  * Implements Drupal\configuration\Config\Configuration::saveToActiveStore().
  */
 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());
 }
Beispiel #2
0
 /**
  * Update an existing WYSIWYG profile.
  *
  * @param string $profile
  *   Text format machine name, for example: "full_html".
  */
 private function updateProfile($profile)
 {
     db_merge('wysiwyg')->key(array('format' => $profile->format))->fields(array('editor' => $profile->editor, 'settings' => serialize($profile->settings)))->execute();
     wysiwyg_profile_cache_clear();
 }