You are here

protected function LingotekContentModerationSettingsForm::getWorkflowStates in Lingotek Translation 8.2

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

Get workflow states helper method.

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

Parameters

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

Return value

\Drupal\workflows\StateInterface[] The states.

2 calls to LingotekContentModerationSettingsForm::getWorkflowStates()
LingotekContentModerationSettingsForm::getDefaultModerationUploadStatus in src/Moderation/LingotekContentModerationSettingsForm.php
Gets the default upload status.
LingotekContentModerationSettingsForm::getModerationUploadStatuses in src/Moderation/LingotekContentModerationSettingsForm.php
Gets the moderation statuses.

File

src/Moderation/LingotekContentModerationSettingsForm.php, line 153

Class

LingotekContentModerationSettingsForm
Moderation settings form for the Lingotek content_moderation integration.

Namespace

Drupal\lingotek\Moderation

Code

protected function getWorkflowStates(WorkflowInterface $workflow) {
  if (floatval(\Drupal::VERSION) >= 8.4) {
    return $workflow
      ->getTypePlugin()
      ->getStates();
  }
  else {
    return $workflow
      ->getStates();
  }
}