function LocaleProjectStorage::disableAll

Same name in other branches
  1. 9 core/modules/locale/src/LocaleProjectStorage.php \Drupal\locale\LocaleProjectStorage::disableAll()
  2. 10 core/modules/locale/src/LocaleProjectStorage.php \Drupal\locale\LocaleProjectStorage::disableAll()
  3. 11.x core/modules/locale/src/LocaleProjectStorage.php \Drupal\locale\LocaleProjectStorage::disableAll()

Overrides LocaleProjectStorageInterface::disableAll

File

core/modules/locale/src/LocaleProjectStorage.php, line 139

Class

LocaleProjectStorage
Provides the locale project storage system using a key value store.

Namespace

Drupal\locale

Code

public function disableAll() {
    $projects = $this->keyValueStore
        ->getAll();
    foreach (array_keys($projects) as $key) {
        $projects[$key]['status'] = 0;
        if (isset($cache[$key])) {
            $cache[$key] = $projects[$key];
        }
    }
    $this->keyValueStore
        ->setMultiple($projects);
}

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