StatisticsBase.php in Translation Management Tool 8
File
src/Plugin/views/field/StatisticsBase.php
View source
<?php
namespace Drupal\tmgmt\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
class StatisticsBase extends FieldPluginBase {
public function preRender(&$values) {
parent::preRender($values);
if ($this
->getEntityType() == 'tmgmt_job') {
$tjids = array();
foreach ($values as $value) {
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);
}
}
}