You are here

public function WysiwygConfigurationHandler::loadFromDatabase in Configuration Management 7.3

Loads the configuration from the database.

Parameters

string $identifier: The identifier of the configuration to load.

Return value

\Configuration\Configuration A configuration object.

Overrides ConfigurationHandler::loadFromDatabase

File

src/Handlers/WysiwygConfigurationHandler.php, line 28

Class

WysiwygConfigurationHandler

Namespace

Configuration\Handlers

Code

public function loadFromDatabase($identifier) {
  $name = $this
    ->getInternalId($identifier);
  $configuration = new Configuration();
  $configuration
    ->setIdentifier($identifier);
  $profile = $this->configuration_manager
    ->drupal()
    ->wysiwyg_get_profile($name);
  if (empty($profile)) {
    $profile = new \StdClass();
    $profile->editor = '';
    $profile->format = $name;
    $profile->settings = array();
  }
  $configuration
    ->setData($profile);
  $this->configuration_manager
    ->newDependency($configuration, 'text_format.' . $name);
  $event = $this
    ->triggerEvent('load_from_database', $configuration);
  return $event->configuration;
}