summaryrefslogtreecommitdiff
path: root/modules/bhavika/company/company.install
diff options
context:
space:
mode:
authorBhavika-keswani2019-07-02 12:41:45 +0530
committerBhavika-keswani2019-07-02 12:41:45 +0530
commit565af64fc81211897625be2b000a28c910174edb (patch)
treec2f74ec442ddbcce89b9c0821d0820770402cd51 /modules/bhavika/company/company.install
parent3ad1b8d590d7d11d83e8c923970690900dc31f70 (diff)
downloadacadmix_distribution-565af64fc81211897625be2b000a28c910174edb.tar.gz
acadmix_distribution-565af64fc81211897625be2b000a28c910174edb.tar.bz2
acadmix_distribution-565af64fc81211897625be2b000a28c910174edb.zip
Custom modules added
Diffstat (limited to 'modules/bhavika/company/company.install')
-rw-r--r--modules/bhavika/company/company.install64
1 files changed, 64 insertions, 0 deletions
diff --git a/modules/bhavika/company/company.install b/modules/bhavika/company/company.install
new file mode 100644
index 0000000..09b0cb0
--- /dev/null
+++ b/modules/bhavika/company/company.install
@@ -0,0 +1,64 @@
+
+<?php
+
+
+/**
+
+
+* Implements hook_uninstall().
+
+
+*/
+
+
+function company_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', 'companies');
+
+
+ $nids = $query->execute();
+
+
+
+
+
+
+
+ // Delete entities.
+
+
+ if (!empty($nids)) {
+
+
+ $entities = $nodeStorage->loadMultiple($nids);
+
+
+ $nodeStorage->delete($entities);
+
+
+ }
+
+
+}