MandrillTemplateMapListBuilder.php in Mandrill 8
File
modules/mandrill_template/src/Controller/MandrillTemplateMapListBuilder.php
View source
<?php
namespace Drupal\mandrill_template\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class MandrillTemplateMapListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Label');
$header['template_id'] = $this
->t('Mandrill Template');
$header['main_section'] = $this
->t('Primary Content Zone');
$header['mailsystem_key'] = $this
->t('In Use By');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label() . ' (Machine name: ' . $entity
->id() . ')';
$row['template_id'] = $entity->template_id;
$row['main_section'] = $entity->main_section;
$row['mailsystem_key'] = $entity->mailsystem_key;
return $row + parent::buildRow($entity);
}
}