You are here

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

Class

ViewConfigurationHandler

Namespace

Configuration\Handlers

Code

public function loadFromDatabase($identifier) {
  $name = $this
    ->getInternalId($identifier);
  $configuration = new Configuration();
  $configuration
    ->setIdentifier($identifier);
  $view = $this->configuration_manager
    ->drupal()
    ->views_get_view($name);
  unset($view->vid);
  $configuration
    ->setData($view);
  $configuration
    ->addModule('views');
  $event = $this
    ->triggerEvent('load_from_database', $configuration);
  return $event->configuration;
}