You are here

class LingotekContentModerationConfigurationService in Lingotek Translation 3.6.x

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

Service for managing content moderation settings in the Lingotek integration.

@package Drupal\lingotek\Moderation

Hierarchy

Expanded class hierarchy of LingotekContentModerationConfigurationService

1 string reference to 'LingotekContentModerationConfigurationService'
lingotek.services.yml in ./lingotek.services.yml
lingotek.services.yml
1 service uses LingotekContentModerationConfigurationService
lingotek.content_moderation_configuration in ./lingotek.services.yml
Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService

File

src/Moderation/LingotekContentModerationConfigurationService.php, line 13

Namespace

Drupal\lingotek\Moderation
View source
class LingotekContentModerationConfigurationService implements LingotekModerationConfigurationServiceInterface {
  use LingotekContentModerationCheckTrait;

  /**
   * The config factory service.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $configFactory;

  /**
   * Constructs a new LingotekContentModerationConfigurationService object.
   *
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory.
   */
  public function __construct(ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
    $this
      ->setModuleHandler($module_handler);
    $this->configFactory = $config_factory;
  }

  /**
   * {@inheritdoc}
   */
  public function getUploadStatus($entity_type_id, $bundle) {
    $config = $this->configFactory
      ->get('lingotek.settings');
    $upload_status = $config
      ->get('translate.entity.' . $entity_type_id . '.' . $bundle . '.content_moderation.upload_status');
    return $upload_status;
  }

  /**
   * {@inheritdoc}
   */
  public function getDownloadTransition($entity_type_id, $bundle) {
    $config = $this->configFactory
      ->get('lingotek.settings');
    $download_transition = $config
      ->get('translate.entity.' . $entity_type_id . '.' . $bundle . '.content_moderation.download_transition');
    return $download_transition;
  }

  /**
   * {@inheritdoc}
   */
  public function setUploadStatus($entity_type_id, $bundle, $status) {
    $config = $this->configFactory
      ->getEditable('lingotek.settings');
    $config
      ->set('translate.entity.' . $entity_type_id . '.' . $bundle . '.content_moderation.upload_status', $status);
    $config
      ->save();
    return $status;
  }

  /**
   * {@inheritdoc}
   */
  public function setDownloadTransition($entity_type_id, $bundle, $transition) {
    $config = $this->configFactory
      ->getEditable('lingotek.settings');
    $config
      ->set('translate.entity.' . $entity_type_id . '.' . $bundle . '.content_moderation.download_transition', $transition);
    $config
      ->save();
    return $transition;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LingotekContentModerationCheckTrait::$moduleHandler protected property The module handler service.
LingotekContentModerationCheckTrait::applies public function
LingotekContentModerationCheckTrait::setModuleHandler public function
LingotekContentModerationConfigurationService::$configFactory protected property The config factory service.
LingotekContentModerationConfigurationService::getDownloadTransition public function Gets the moderation transition ID that triggers a download. Overrides LingotekModerationConfigurationServiceInterface::getDownloadTransition
LingotekContentModerationConfigurationService::getUploadStatus public function Gets the moderation status ID that triggers an upload. Overrides LingotekModerationConfigurationServiceInterface::getUploadStatus
LingotekContentModerationConfigurationService::setDownloadTransition public function Sets the moderation transition ID that triggers a download. Overrides LingotekModerationConfigurationServiceInterface::setDownloadTransition
LingotekContentModerationConfigurationService::setUploadStatus public function Sets the moderation status ID that triggers an upload. Overrides LingotekModerationConfigurationServiceInterface::setUploadStatus
LingotekContentModerationConfigurationService::__construct public function Constructs a new LingotekContentModerationConfigurationService object.