You are here

public function LingotekApi::getWorkflow in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getWorkflow()

Gets Lingotek Workflow by ID

Parameters

$id: a string containing the workflow ID

$reset: A boolean value to determine whether we need to query the API

Return value

array An array of workflow details

File

lib/Drupal/lingotek/LingotekApi.php, line 923
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function getWorkflow($id, $reset = FALSE) {
  $workflow = variable_get('lingotek_workflow_' . $id, array());
  if (!empty($workflow) && $reset == FALSE) {
    return $workflow;
  }
  $response = $this
    ->request('getWorkflow', array(
    'id' => $id,
  ));
  if (!empty($response->results) && $response->results == 'success') {
    $workflow = $response->workflow;
    variable_set('lingotek_workflow_' . $id, $workflow);
  }
  return $workflow;
}