You are here

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

Class

VocabularyConfigurationHandler

Namespace

Configuration\Handlers

Code

public function loadFromDatabase($identifier) {
  $name = $this
    ->getInternalId($identifier);
  $configuration = new Configuration();
  $configuration
    ->setIdentifier($identifier);
  $vocabulary = $this->configuration_manager
    ->drupal()
    ->taxonomy_vocabulary_machine_name_load($name);
  unset($vocabulary->vid);
  $configuration
    ->setData($vocabulary);
  $configuration
    ->addModule('taxonomy');
  $event = $this
    ->triggerEvent('load_from_database', $configuration);
  $event_settings = array(
    'entity_type' => 'taxonomy_term',
    'bundle_name' => $vocabulary->machine_name,
  );
  $event = $this
    ->triggerEvent('load_from_database.entity', $event->configuration, $event_settings, FALSE);
  return $event->configuration;
}