You are here

public static function LingotekSync::updateConfigSetWorkflow in Lingotek Translation 7.7

1 call to LingotekSync::updateConfigSetWorkflow()
lingotek_entity_change_workflow in ./lingotek.module
Changes an entity's workflow locally and on the TMS

File

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

Class

LingotekSync
A utility class for Lingotek Syncing.

Code

public static function updateConfigSetWorkflow($set_id, $workflow_id) {
  $insertRecord = array(
    "value" => $workflow_id,
    "created" => time(),
    "modified" => time(),
    "id" => $set_id,
    "config_key" => 'workflow_id',
  );
  $updateRecord = array(
    "value" => $workflow_id,
    "modified" => time(),
  );
  db_merge('lingotek_config_metadata')
    ->key(array(
    'id' => $set_id,
    'config_key' => 'workflow_id',
  ))
    ->insertFields($insertRecord)
    ->updateFields($updateRecord)
    ->execute();

  //    drupal_write_record('lingotek_config_metadata', $record);
}