Last active
January 31, 2017 18:42
-
-
Save derhasi/e9df432f499712e848764e1fa32b3201 to your computer and use it in GitHub Desktop.
Delete all entities of a entity type $entity_type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$controller = \Drupal::entityManager()->getStorage($entity_type); | |
$entities = $controller->loadMultiple(NULL); | |
dvm(array_keys($entities)); | |
$controller->delete($entities); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment