You are here

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

Class

FieldInstanceConfigurationHandler

Namespace

Configuration\Handlers

Code

public function removeFromDatabase(Configuration $configuration) {
  $name = $this
    ->getInternalId($configuration
    ->getIndentifier());
  list($entity_type, $bundle, $field_name) = explode('.', $name);
  $instance = $this->configuration_manager
    ->drupal()
    ->field_info_instance($entity_type, $field_name, $bundle);
  $this->configuration_manager
    ->drupal()
    ->field_delete_instance($instance, TRUE);
  $this->purge_batch++;
}