You are here

function faq_uninstall in Frequently Asked Questions 8

Same name and namespace in other branches
  1. 5.2 faq.install \faq_uninstall()
  2. 5 faq.install \faq_uninstall()
  3. 6 faq.install \faq_uninstall()
  4. 7 faq.install \faq_uninstall()

File

./faq.install, line 54
FAQ module install file.

Code

function faq_uninstall() {
  $info = NodeType::load('faq');
  if ($info) {
    $info
      ->delete();
    field_purge_batch(500);
    $nids = \Drupal::entityQuery('node')
      ->condition('type', 'faq')
      ->execute();
    foreach ($nids as $nid) {
      $faqNode = Node::load($nid);
      $faqNode
        ->delete();
    }
  }
}