MediaBulkConfigListBuilder.php in Media Bulk Upload 8
File
src/MediaBulkConfigListBuilder.php
View source
<?php
namespace Drupal\media_bulk_upload;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class MediaBulkConfigListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Media Bulk Config');
$header['id'] = $this
->t('Machine name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['id'] = $entity
->id();
return $row + parent::buildRow($entity);
}
public function render() {
$build = parent::render();
$build['table']['#empty'] = $this
->t('No media types available. <a href=":url">Add media type</a>.', [
':url' => Url::fromRoute('entity.media_bulk_config.add_form')
->toString(),
]);
return $build;
}
}