You are here

public function WysiwygConfigurationHandler::writeToDatabase in Configuration Management 7.3

Saves the given configuration into the database.

Parameters

\Configuration\Configuration $configuration: The configuration to be saved.

Overrides ConfigurationHandler::writeToDatabase

File

src/Handlers/WysiwygConfigurationHandler.php, line 49

Class

WysiwygConfigurationHandler

Namespace

Configuration\Handlers

Code

public function writeToDatabase(Configuration $configuration) {
  $name = $this
    ->getInternalId($configuration
    ->getIdentifier());
  $event = $this
    ->triggerEvent('write_to_database', $configuration);
  $profile_array = $event->configuration
    ->getData();
  $profile = new \StdClass();
  $profile->format = $profile_array["format"];
  $profile->editor = $profile_array["editor"];
  $profile->settings = $profile_array["settings"];
  $this->configuration_manager
    ->drupal()
    ->wysiwyg_saveProfile($profile);
  $this->configuration_manager
    ->drupal()
    ->wysiwyg_profile_cache_clear();
}