You are here

public function LingotekWorkbenchModerationSettingsForm::getDefaultModerationUploadStatus in Lingotek Translation 3.5.x

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

Gets the default upload status.

Parameters

string $entity_type_id: The entity type id.

string $bundle: The bundle id.

Return value

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

Overrides LingotekModerationSettingsFormInterface::getDefaultModerationUploadStatus

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

File

src/Moderation/LingotekWorkbenchModerationSettingsForm.php, line 107

Class

LingotekWorkbenchModerationSettingsForm
Moderation settings form for the Lingotek workbench_moderation integration.

Namespace

Drupal\lingotek\Moderation

Code

public function getDefaultModerationUploadStatus($entity_type_id, $bundle) {
  $status = $this->moderationConfiguration
    ->getUploadStatus($entity_type_id, $bundle);
  if (!$status) {
    $published_statuses = $this->entityTypeManager
      ->getStorage('moderation_state')
      ->getQuery()
      ->condition('published', TRUE)
      ->execute();
    if (count($published_statuses) > 0) {
      $status = reset($published_statuses);
    }
  }
  return $status;
}