You are here

public function VocabularyConfigurationHandler::removeFromDatabase in Configuration Management 7.3

Deletes a configuration from the database.

Parameters

\Configuration\Configuration $configuration: The configuration to be deleted.

Overrides ConfigurationHandler::removeFromDatabase

File

src/Handlers/VocabularyConfigurationHandler.php, line 66

Class

VocabularyConfigurationHandler

Namespace

Configuration\Handlers

Code

public function removeFromDatabase(Configuration $configuration) {
  $name = $this
    ->getInternalId($configuration
    ->getIdentifier());
  $existent_vocabulary = $this->configuration_manager
    ->drupal()
    ->taxonomy_vocabulary_machine_name_load($name);
  $vocabulary = $configuration
    ->getData();
  $vocabulary->vid = $existent_vocabulary->vid;
  $event = $this
    ->triggerEvent('remove_from_database', $configuration);
  $this->configuration_manager
    ->drupal()
    ->taxonomy_vocabulary_delete($vocabulary->vid);
}