You are here

public function NodeStorage::clearRevisionsLanguage in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/src/NodeStorage.php \Drupal\node\NodeStorage::clearRevisionsLanguage()

Unsets the language for all nodes with the given language.

Parameters

\Drupal\Core\Language\LanguageInterface $language: The language object.

Overrides NodeStorageInterface::clearRevisionsLanguage

File

core/modules/node/src/NodeStorage.php, line 57

Class

NodeStorage
Defines the storage handler class for nodes.

Namespace

Drupal\node

Code

public function clearRevisionsLanguage(LanguageInterface $language) {
  return $this->database
    ->update($this
    ->getRevisionTable())
    ->fields([
    'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
  ])
    ->condition('langcode', $language
    ->getId())
    ->execute();
}