class LingotekContentModerationConfigurationService in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8.2 src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 4.0.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.0.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.1.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.2.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.3.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.5.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.6.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 3.7.x src/Moderation/LingotekContentModerationConfigurationService.php \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService
- 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
- class \Drupal\lingotek\Moderation\LingotekContentModerationConfigurationService implements LingotekModerationConfigurationServiceInterface uses LingotekContentModerationCheckTrait
Expanded class hierarchy of LingotekContentModerationConfigurationService
1 string reference to 'LingotekContentModerationConfigurationService'
1 service uses LingotekContentModerationConfigurationService
File
- src/
Moderation/ LingotekContentModerationConfigurationService.php, line 13
Namespace
Drupal\lingotek\ModerationView 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;
}
}