summaryrefslogtreecommitdiff
path: root/modules/esha/lab/lab.install
diff options
context:
space:
mode:
authorEsha2019-07-02 12:42:54 +0530
committerEsha2019-07-02 12:43:10 +0530
commit141ce8c97abe36f1f8bb06a38623e93563d6c618 (patch)
tree2086c9224072aa7b917da20487b232eb2ef0666e /modules/esha/lab/lab.install
parent847360bf5ac011771dc013677542ece7b356a528 (diff)
downloadacadmix_distribution-141ce8c97abe36f1f8bb06a38623e93563d6c618.tar.gz
acadmix_distribution-141ce8c97abe36f1f8bb06a38623e93563d6c618.tar.bz2
acadmix_distribution-141ce8c97abe36f1f8bb06a38623e93563d6c618.zip
Custom modules
Diffstat (limited to 'modules/esha/lab/lab.install')
-rw-r--r--modules/esha/lab/lab.install22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/esha/lab/lab.install b/modules/esha/lab/lab.install
new file mode 100644
index 0000000..376861b
--- /dev/null
+++ b/modules/esha/lab/lab.install
@@ -0,0 +1,22 @@
+
+<?php
+/**
+* Implements hook_uninstall().
+*/
+function lab_uninstall() { //<-- replace “welcome” with your module machine name
+ // 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', 'lab');
+ $nids = $query->execute();
+
+ // Delete entities.
+ if (!empty($nids)) {
+ $entities = $nodeStorage->loadMultiple($nids);
+ $nodeStorage->delete($entities);
+ }
+}