MigrationGroupListBuilder.php in Migrate Tools 8.5
File
src/Controller/MigrationGroupListBuilder.php
View source
<?php
namespace Drupal\migrate_tools\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;
class MigrationGroupListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Migration Group');
$header['machine_name'] = $this
->t('Machine Name');
$header['description'] = $this
->t('Description');
$header['source_type'] = $this
->t('Source Type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['machine_name'] = $entity
->id();
$row['description'] = $entity
->get('description');
$row['source_type'] = $entity
->get('source_type');
return $row + parent::buildRow($entity);
}
public function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity);
$operations['list'] = [
'title' => $this
->t('List migrations'),
'weight' => 0,
'url' => Url::fromRoute('entity.migration.list', [
'migration_group' => $entity
->id(),
]),
];
return $operations;
}
}