You are here

public static function LingotekSync::setAllTargetStatus in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.4 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::setAllTargetStatus()
  2. 7.5 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::setAllTargetStatus()
  3. 7.6 lib/Drupal/lingotek/LingotekSync.php \LingotekSync::setAllTargetStatus()
1 call to LingotekSync::setAllTargetStatus()
lingotek_entity_save in ./lingotek.module

File

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

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function setAllTargetStatus($entity_type, $entity_id, $status) {
  if ($entity_type === 'config') {
    $query = db_update('lingotek_config_metadata')
      ->condition('id', $entity_id, "=")
      ->condition('config_key', 'target_sync_status%', 'LIKE')
      ->fields(array(
      'value' => $status,
      'modified' => time(),
    ))
      ->execute();
    return;
  }
  $query = db_update('lingotek_entity_metadata')
    ->condition('entity_type', $entity_type)
    ->condition('entity_id', $entity_id)
    ->condition('entity_key', 'target_sync_status%', 'LIKE')
    ->fields(array(
    'value' => $status,
    'modified' => time(),
  ))
    ->execute();
  lingotek_cache_clear($entity_type, $entity_id);
}