From 141ce8c97abe36f1f8bb06a38623e93563d6c618 Mon Sep 17 00:00:00 2001 From: Esha Date: Tue, 2 Jul 2019 12:42:54 +0530 Subject: Custom modules --- modules/esha/labmanual/labmanual.install | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/esha/labmanual/labmanual.install (limited to 'modules/esha/labmanual/labmanual.install') diff --git a/modules/esha/labmanual/labmanual.install b/modules/esha/labmanual/labmanual.install new file mode 100644 index 0000000..e2c0ed3 --- /dev/null +++ b/modules/esha/labmanual/labmanual.install @@ -0,0 +1,22 @@ + +getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'lab_manual'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} -- cgit