SmsGatewayListBuilder.php in SMS Framework 2.x
File
src/Lists/SmsGatewayListBuilder.php
View source
<?php
declare (strict_types=1);
namespace Drupal\sms\Lists;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class SmsGatewayListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Label');
$header['gateway'] = $this
->t('Gateway');
$header['status'] = $this
->t('Status');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['gateway'] = $entity
->getPlugin()
->getPluginDefinition()['label'];
$row['status'] = $entity
->status() ? $this
->t('Enabled') : $this
->t('Disabled');
return $row + parent::buildRow($entity);
}
public function render() {
$render = parent::render();
$render['table']['#empty'] = t('No gateways found.');
return $render;
}
}