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