You are here

function file_management_view_uninstall in File Management 8

Implements hook_uninstall().

File

modules/file_management_view/file_management_view.install, line 24
Install, update and uninstall functions for the file_management_view module.

Code

function file_management_view_uninstall() {

  // Remove our own view.
  $file_management_view = \Drupal::entityTypeManager()
    ->getStorage('view')
    ->load('file_management');
  $file_management_view
    ->delete();

  // Re-enable the existing files view.
  $files_view = \Drupal::entityTypeManager()
    ->getStorage('view')
    ->load('files');
  if (!empty($files_view)) {
    $files_view
      ->setStatus(TRUE);
    $files_view
      ->save();
  }
}