function tmgmt_job_statistic

Returns a specific statistic of a job.

Parameters

$job: The translation job entity.

$key: One of word_count, tags_count, count_pending, count_accepted, count_reviewed and count_translated.

Return value

The requested information as an integer.

Related topics

7 calls to tmgmt_job_statistic()
Job::getCountAccepted in src/Entity/Job.php
Sums up all accepted counts of this jobs job items.
Job::getCountPending in src/Entity/Job.php
Sums up all pending counts of this jobs job items.
Job::getCountReviewed in src/Entity/Job.php
Sums up all reviewed counts of this jobs job items.
Job::getCountTranslated in src/Entity/Job.php
Sums up all translated counts of this jobs job items.
Job::getFileCount in src/Entity/Job.php
Sums up all file counts of this jobs job items.

... See full list

File

./tmgmt.module, line 374
Main module file for the Translation Management module.

Code

function tmgmt_job_statistic(JobInterface $job, $key) {
  $statistics = tmgmt_job_statistics_load(array(
    $job
      ->id(),
  ));
  if (isset($statistics[$job
    ->id()]->{$key})) {
    return $statistics[$job
      ->id()]->{$key};
  }
  return 0;
}