diff options
Diffstat (limited to 'modules/mansimran/startups/startups.install')
-rw-r--r-- | modules/mansimran/startups/startups.install | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/mansimran/startups/startups.install b/modules/mansimran/startups/startups.install new file mode 100644 index 0000000..273a08b --- /dev/null +++ b/modules/mansimran/startups/startups.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function startups_uninstall() { + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'startups'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + |