diff options
Diffstat (limited to 'modules/mansimran/administrative_offices/administrative_offices.install')
-rw-r--r-- | modules/mansimran/administrative_offices/administrative_offices.install | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/mansimran/administrative_offices/administrative_offices.install b/modules/mansimran/administrative_offices/administrative_offices.install new file mode 100644 index 0000000..7985f05 --- /dev/null +++ b/modules/mansimran/administrative_offices/administrative_offices.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function administrative_offices_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', 'administrative_offices'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + |