You are here

public static function LingotekSync::setEntityTranslationPublishedSetting in Lingotek Translation 7.7

Sets the published status for entity translations

1 call to LingotekSync::setEntityTranslationPublishedSetting()
lingotek_set_translation_published_state in ./lingotek.util.inc
Sets the translation published state from the Lingotek preference

File

lib/Drupal/lingotek/LingotekSync.php, line 1441
LingotekSync

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function setEntityTranslationPublishedSetting($entity_id, $entity_type, $language, $new_published_setting) {
  db_update('entity_translation')
    ->fields(array(
    'status' => $new_published_setting,
  ))
    ->condition('entity_id', $entity_id)
    ->condition('entity_type', $entity_type)
    ->condition('language', $language)
    ->execute();
  db_update('entity_translation_revision')
    ->fields(array(
    'status' => $new_published_setting,
  ))
    ->condition('entity_id', $entity_id)
    ->condition('entity_type', $entity_type)
    ->condition('language', $language)
    ->execute();
}