function Views::getDisabledViews

Same name in other branches
  1. 9 core/modules/views/src/Views.php \Drupal\views\Views::getDisabledViews()
  2. 8.9.x core/modules/views/src/Views.php \Drupal\views\Views::getDisabledViews()
  3. 10 core/modules/views/src/Views.php \Drupal\views\Views::getDisabledViews()

Returns an array of all disabled views.

Return value

\Drupal\views\Entity\View[] An array of loaded disabled view entities.

1 call to Views::getDisabledViews()
ModuleTest::testLoadFunctions in core/modules/views/tests/src/Kernel/ModuleTest.php
Tests the load wrapper/helper functions.

File

core/modules/views/src/Views.php, line 273

Class

Views
Static service container wrapper for views.

Namespace

Drupal\views

Code

public static function getDisabledViews() {
    $query = \Drupal::entityQuery('view')->condition('status', FALSE)
        ->execute();
    return \Drupal::entityTypeManager()->getStorage('view')
        ->loadMultiple($query);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.