function CurrentImportStorage::delete

Deletes the information for the given projects and languages.

Parameters

array $projects: Project name(s) to be deleted from the import state storage. If both project(s) and language code(s) are specified the conditions will be ANDed.

array $langcodes: Language code(s) to be deleted from the import state storage.

File

core/modules/locale/src/CurrentImportStorage.php, line 113

Class

CurrentImportStorage
Provides the locale current import state service.

Namespace

Drupal\locale

Code

public function delete(array $projects, array $langcodes = []) : void {
  $query = $this->database
    ->delete('locale_file');
  if (!empty($projects)) {
    $query->condition('project', $projects, 'IN');
  }
  if (!empty($langcodes)) {
    $query->condition('langcode', $langcodes, 'IN');
  }
  $query->execute();
  $this->cacheTagsInvalidator
    ->invalidateTags([
    self::LOCALE_CURRENT_IMPORT_CACHE_TAG,
  ]);
}

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