EntityLastInstalledSchemaRepository::deleteLastInstalledDefinition

public EntityLastInstalledSchemaRepository::deleteLastInstalledDefinition($entity_type_id)

Deletes the entity type definition from the application state.

Parameters

string $entity_type_id: The entity type definition identifier.

Return value

$this

Overrides EntityLastInstalledSchemaRepositoryInterface::deleteLastInstalledDefinition

File

core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepository.php, line 49

Class

EntityLastInstalledSchemaRepository
Provides a repository for installed entity definitions.

Namespace

Drupal\Core\Entity

Code

public function deleteLastInstalledDefinition($entity_type_id) {
  $this->keyValueFactory->get('entity.definitions.installed')->delete($entity_type_id . '.entity_type');
  // Clean up field storage definitions as well. Even if the entity type
  // isn't currently fieldable, there might be legacy definitions or an
  // empty array stored from when it was.
  $this->keyValueFactory->get('entity.definitions.installed')->delete($entity_type_id . '.field_storage_definitions');
  return $this;
}
doc_Drupal
2016-10-29 09:06:46
Comments
Leave a Comment

Please login to continue.