You are here

public function LingotekApi::changeWorkflow in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::changeWorkflow()
  2. 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::changeWorkflow()
  3. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::changeWorkflow()

Updates one or more nids to belong to a given workflow

Parameters

array $document_ids: An array of document IDs

string $workflow_id: A string containing the desired workflow_id

string $prefillPhase: An optional parameter specifying the prefill phase

Return value

bool TRUE on success, FALSE on failure.

File

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

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function changeWorkflow($document_ids, $workflow_id, $prefillPhase = NULL) {
  $parameters = array(
    'documentId' => $document_ids,
    'workflowId' => $workflow_id,
    'preserveTargets' => 'true',
  );
  if ($prefillPhase) {
    $parameters['prefillPhase'] = $prefillPhase;
  }
  return $this
    ->request('resetDocument', $parameters) ? TRUE : FALSE;
}