You are here

public function TextFormatConfigurationHandler::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/TextFormatConfigurationHandler.php, line 51

Class

TextFormatConfigurationHandler

Namespace

Configuration\Handlers

Code

public function writeToDatabase(Configuration $configuration) {
  $event = $this
    ->triggerEvent('write_to_database', $configuration);
  $format_array = $event->configuration
    ->getData();
  $format = new \StdClass();
  $format->format = $format_array["format"];
  $format->name = $format_array["name"];
  $format->cache = $format_array["cache"];
  $format->status = $format_array["status"];
  $format->weight = $format_array["weight"];
  $format->filters = $format_array["filters"];
  $this->configuration_manager
    ->drupal()
    ->filter_format_save($format);
}