class LingotekModerationFactory in Lingotek Translation 3.1.x
Same name and namespace in other branches
- 8.2 src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 4.0.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.0.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.2.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.3.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.4.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.5.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.6.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.7.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
- 3.8.x src/Moderation/LingotekModerationFactory.php \Drupal\lingotek\Moderation\LingotekModerationFactory
A facade for getting the services that are part of moderation integrations.
@package Drupal\lingotek\Moderation
Hierarchy
- class \Drupal\lingotek\Moderation\LingotekModerationFactory implements LingotekModerationFactoryInterface
Expanded class hierarchy of LingotekModerationFactory
1 file declares its use of LingotekModerationFactory
- LingotekModerationFactoryTest.php in tests/
src/ Unit/ Moderation/ LingotekModerationFactoryTest.php
1 string reference to 'LingotekModerationFactory'
1 service uses LingotekModerationFactory
File
- src/
Moderation/ LingotekModerationFactory.php, line 10
Namespace
Drupal\lingotek\ModerationView source
class LingotekModerationFactory implements LingotekModerationFactoryInterface {
/**
* The collected moderation config services.
*
* @var LingotekModerationConfigurationServiceInterface[]
*/
protected $config;
/**
* The collected moderation form settings services.
*
* @var LingotekModerationSettingsFormInterface[]
*/
protected $forms;
/**
* The collected moderation handler services.
*
* @var LingotekModerationHandlerInterface[]
*/
protected $handlers;
/**
* Constructs a \Drupal\lingotek\Moderation\LingotekModerationFactory object.
*/
public function __construct() {
$this->config = [];
$this->forms = [];
$this->handlers = [];
}
/**
* {@inheritdoc}
*/
public function addModerationConfiguration(LingotekModerationConfigurationServiceInterface $service, $id, $priority) {
$this->config[$priority] = $service;
krsort($this->config);
}
/**
* {@inheritdoc}
*/
public function addModerationForm(LingotekModerationSettingsFormInterface $service, $id, $priority) {
$this->forms[$priority] = $service;
krsort($this->forms);
}
/**
* {@inheritdoc}
*/
public function addModerationHandler(LingotekModerationHandlerInterface $service, $id, $priority) {
$this->handlers[$priority] = $service;
krsort($this->handlers);
}
/**
* {@inheritdoc}
*/
public function getModerationConfigurationService() {
foreach ($this->config as $service) {
if ($service
->applies()) {
return $service;
}
}
}
/**
* {@inheritdoc}
*/
public function getModerationSettingsForm() {
foreach ($this->forms as $service) {
if ($service
->applies()) {
return $service;
}
}
}
/**
* {@inheritdoc}
*/
public function getModerationHandler() {
foreach ($this->handlers as $service) {
if ($service
->applies()) {
return $service;
}
}
}
}