You are here

protected function LingotekContentModerationSettingsForm::getWorkflowTransitionsForState in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 4.0.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  2. 3.0.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  3. 3.1.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  4. 3.2.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  5. 3.3.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  6. 3.4.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  7. 3.5.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  8. 3.6.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  9. 3.7.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
  10. 3.8.x src/Moderation/LingotekContentModerationSettingsForm.php \Drupal\lingotek\Moderation\LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()

Get workflow transitions for a given state helper method.

Needed because of differences in 8.3.x and 8.4.x.

Parameters

\Drupal\workflows\WorkflowInterface $workflow: The workflow.

string $state: State id.

Return value

\Drupal\workflows\TransitionInterface[] An array of transition objects.

1 call to LingotekContentModerationSettingsForm::getWorkflowTransitionsForState()
LingotekContentModerationSettingsForm::getDefaultModerationDownloadTransition in src/Moderation/LingotekContentModerationSettingsForm.php
Gets the default transition.

File

src/Moderation/LingotekContentModerationSettingsForm.php, line 196

Class

LingotekContentModerationSettingsForm
Moderation settings form for the Lingotek content_moderation integration.

Namespace

Drupal\lingotek\Moderation

Code

protected function getWorkflowTransitionsForState(WorkflowInterface $workflow, $state) {
  if (floatval(\Drupal::VERSION) >= 8.4) {
    return $workflow
      ->getTypePlugin()
      ->getTransitionsForState($state);
  }
  else {
    return $workflow
      ->getTransitionsForState($state);
  }
}