You are here

function tmgmt_local_task_statistic in Translation Management Tool 7

Same name and namespace in other branches
  1. 8 translators/tmgmt_local/tmgmt_local.module \tmgmt_local_task_statistic()

Returns a specific statistic of a task.

Parameters

$task: The translation task entity.

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

Return value

The requested information as an integer.

4 calls to tmgmt_local_task_statistic()
TMGMTLocalTask::getCountCompleted in translators/tmgmt_local/entity/tmgmt_local.entity.task.inc
Count of all completed data items.
TMGMTLocalTask::getCountTranslated in translators/tmgmt_local/entity/tmgmt_local.entity.task.inc
Count of all translated data items.
TMGMTLocalTask::getCountUntranslated in translators/tmgmt_local/entity/tmgmt_local.entity.task.inc
Count of all untranslated data items.
TMGMTLocalTask::getWordCount in translators/tmgmt_local/entity/tmgmt_local.entity.task.inc
Sums up all word counts of this task job items.

File

translators/tmgmt_local/tmgmt_local.module, line 506
Main module file for the local translation module.

Code

function tmgmt_local_task_statistic(TMGMTLocalTask $task, $key) {
  $statistics = tmgmt_local_task_statistics_load(array(
    $task->tltid,
  ));
  if (isset($statistics[$task->tltid]->{$key})) {
    return $statistics[$task->tltid]->{$key};
  }
  return 0;
}