next_views_entity_reference-8.x-1.0-beta2/next_view_entity_reference_example/next_views_entity_reference_example.install

next_view_entity_reference_example/next_views_entity_reference_example.install
<?php

use \Drupal\views\Views;

/**
 * @file
 * Contains next_views_entity_reference_example.install.
 */

/**
 * Implements hook_uninstall().
 */
function next_views_entity_reference_example_uninstall() {

  // Delete all nodes.
  $storage_handler = \Drupal::entityTypeManager()
    ->getStorage('node');
  $nodes = $storage_handler->loadByProperties(['type' => 'example_artcle']);
  $storage_handler->delete($nodes);

  // Delete content type.
  $content_type = \Drupal::entityTypeManager()
    ->getStorage('node_type')
    ->load('example_article');
  if ($content_type) {
    $content_type->delete();
  }

  // Delete views.
  if ($view = Views::getView('next_tags_example')) {
    $view->delete();
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc