You are here

public function LocaleProjectStorage::disableAll in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/LocaleProjectStorage.php \Drupal\locale\LocaleProjectStorage::disableAll()

Mark all projects as disabled.

Overrides LocaleProjectStorageInterface::disableAll

File

core/modules/locale/src/LocaleProjectStorage.php, line 144
Contains \Drupal\locale\LocaleProjectStorage.

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);
}