You are here

public function OpignoAnswerStorage::clearRevisionsLanguage in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/OpignoAnswerStorage.php \Drupal\opigno_module\OpignoAnswerStorage::clearRevisionsLanguage()

Unsets the language for all Answer with the given language.

Parameters

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

Overrides OpignoAnswerStorageInterface::clearRevisionsLanguage

File

src/OpignoAnswerStorage.php, line 51

Class

OpignoAnswerStorage
Defines the storage handler class for Answer entities.

Namespace

Drupal\opigno_module

Code

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