You are here

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

Class

ViewConfigurationHandler

Namespace

Configuration\Handlers

Code

public function removeFromDatabase(Configuration $configuration) {
  $name = $this
    ->getInternalId($configuration
    ->getIdentifier());
  $event = $this
    ->triggerEvent('remove_from_database', $configuration);
  $view = $this->configuration_manager
    ->drupal()
    ->views_get_view($name);
  if (!empty($view)) {
    $this->configuration_manager
      ->drupal()
      ->views_delete_view($view);
  }
}