You are here

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

Class

MenuConfigurationHandler

Namespace

Configuration\Handlers

Code

public function loadFromDatabase($identifier) {
  $name = $this
    ->getInternalId($identifier);
  $menu = $this->configuration_manager
    ->drupal()
    ->menu_load(str_replace('_', '-', $name));
  $configuration = new Configuration();
  $configuration
    ->setIdentifier($identifier);
  $configuration
    ->setData($menu);
  $event = $this
    ->triggerEvent('load_from_database', $configuration);
  return $event->configuration;
}