You are here

public function LingotekWorkbenchModerationSettingsForm::getModerationDownloadTransitions in Lingotek Translation 4.0.x

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

Gets the default download transition.

Parameters

string $entity_type_id: The entity type id.

string $bundle: The bundle id.

Return value

string The default transition ID. If there is a setting, that will be returned.

Overrides LingotekModerationSettingsFormInterface::getModerationDownloadTransitions

1 call to LingotekWorkbenchModerationSettingsForm::getModerationDownloadTransitions()
LingotekWorkbenchModerationSettingsForm::form in src/Moderation/LingotekWorkbenchModerationSettingsForm.php
Gets the subform for configuring the settings for a given bundle.

File

src/Moderation/LingotekWorkbenchModerationSettingsForm.php, line 122

Class

LingotekWorkbenchModerationSettingsForm
Moderation settings form for the Lingotek workbench_moderation integration.

Namespace

Drupal\lingotek\Moderation

Code

public function getModerationDownloadTransitions($entity_type_id, $bundle) {
  $transitions = $this->entityTypeManager
    ->getStorage('moderation_state_transition')
    ->loadMultiple();
  $values = [];
  $states = $this
    ->getModerationUploadStatuses($entity_type_id, $bundle);

  /** @var \Drupal\workbench_moderation\ModerationStateTransitionInterface $transition */
  foreach ($transitions as $transition_id => $transition) {
    $values[$transition_id] = $this
      ->t('@label [@from_state => @to_state]', [
      '@label' => $transition
        ->label(),
      '@from_state' => $states[$transition
        ->getFromState()],
      '@to_state' => $states[$transition
        ->getToState()],
    ]);
  }
  return $values;
}