Base class for tmgmt fields.
Expanded class hierarchy of StatisticsBase
class StatisticsBase extends FieldPluginBase {
/**
* Prefetch statistics for all jobs.
*/
public function preRender(&$values) {
parent::preRender($values);
// In case of jobs or tasks, pre-fetch the statistics in a single query and
// add them to the static cache.
if ($this
->getEntityType() == 'tmgmt_job') {
$tjids = array();
foreach ($values as $value) {
// Skip loading data for continuous jobs.
if ($this
->getEntity($value)
->isContinuous()) {
continue;
}
$tjids[] = $this
->getValue($value);
}
tmgmt_job_statistics_load($tjids);
}
elseif ($this
->getEntityType() == 'tmgmt_task') {
$tltids = array();
foreach ($values as $value) {
$tltids[] = $value->tjid;
}
tmgmt_local_task_statistics_load($tltids);
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StatisticsBase:: |
public | function | Prefetch statistics for all jobs. |