public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
// Add provider logo.
/** @var \Drupal\tmgmt\Entity\Translator $entity */
$definition = \Drupal::service('plugin.manager.tmgmt.translator')
->getDefinition($entity
->getPluginId());
$npath = \Drupal::service('extension.list.module')
->getPath($definition['provider']);
if (isset($definition['logo'])) {
$logo_render_array = [
'#theme' => 'image',
'#uri' => \Drupal::service('file_url_generator')
->generateAbsoluteString($npath . '/' . $definition['logo']),
'#alt' => $definition['label'],
'#title' => $definition['label'],
'#attributes' => [
'class' => 'tmgmt-logo-overview',
],
];
}
$row['logo'] = isset($logo_render_array) ? $logo_render_array : [
'#markup' => $definition['label'],
];
return $row + parent::buildRow($entity);
}