class LingotekJobManagementService in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8.2 src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 4.0.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.0.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.1.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.2.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.3.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.5.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.6.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.7.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
- 3.8.x src/LingotekJobManagementService.php \Drupal\lingotek\LingotekJobManagementService
Hierarchy
- class \Drupal\lingotek\LingotekJobManagementService
Expanded class hierarchy of LingotekJobManagementService
File
- src/
LingotekJobManagementService.php, line 5
Namespace
Drupal\lingotekView source
class LingotekJobManagementService {
public function getAllContentJobs(array &$jobs) {
$entity_query = \Drupal::entityQuery('lingotek_content_metadata');
$entity_query
->exists('job_id');
$ids = $entity_query
->execute();
$metadatas = $this
->entityTypeManager()
->getStorage('lingotek_content_metadata')
->loadMultiple($ids);
/** @var \Drupal\lingotek\Entity\LingotekContentMetadata $metadata */
foreach ($metadatas as $metadata) {
$job_id = $metadata
->getJobId();
if (!empty($job_id)) {
if (!isset($jobs[$job_id])) {
$jobs[$job_id] = [
'id' => $job_id,
'content' => 0,
'config' => 0,
];
}
++$jobs[$job_id]['content'];
}
}
return $jobs;
}
public function getAllConfigJobs(array &$jobs) {
$entity_query = \Drupal::entityQuery('lingotek_config_metadata');
$entity_query
->exists('job_id');
$ids = $entity_query
->execute();
$metadatas = $this
->entityTypeManager()
->getStorage('lingotek_config_metadata')
->loadMultiple($ids);
/** @var \Drupal\lingotek\Entity\LingotekConfigMetadata $metadata */
foreach ($metadatas as $metadata) {
$job_id = $metadata
->getJobId();
if (!empty($job_id)) {
if (!isset($jobs[$job_id])) {
$jobs[$job_id] = [
'id' => $job_id,
'content' => 0,
'config' => 0,
];
}
++$jobs[$job_id]['config'];
}
}
return $jobs;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LingotekJobManagementService:: |
public | function | ||
LingotekJobManagementService:: |
public | function |