You are here

public function i18n_translation_set::clean_translations in Internationalization 7

Clean all items in this translation set

Unlink other items (not current translations from this translation set)

1 call to i18n_translation_set::clean_translations()
i18n_translation_set::update in i18n_translation/i18n_translation.inc
Update a translation set
1 method overrides i18n_translation_set::clean_translations()
i18n_path_translation_set::clean_translations in i18n_path/i18n_path.inc
Clean path translations.

File

i18n_translation/i18n_translation.inc, line 132
Internationalization (i18n) module - Translation set

Class

i18n_translation_set
@file Internationalization (i18n) module - Translation set

Code

public function clean_translations() {
  if (($table = $this
    ->get_table()) && ($field = $this
    ->get_field())) {
    $query = db_update($table)
      ->fields(array(
      $field => 0,
    ))
      ->condition($field, $this->tsid);
    if ($translations = $this
      ->get_translations()) {
      $query
        ->condition('language', array_keys($translations), 'NOT IN');
    }
    return $query
      ->execute();
  }
}