3 namespace Drupal\migrate_tools\Controller;
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
10 * Provides a listing of migration group entities.
12 * @package Drupal\migrate_tools\Controller
14 * @ingroup migrate_tools
16 class MigrationGroupListBuilder extends ConfigEntityListBuilder {
19 * Builds the header row for the entity listing.
22 * A render array structure of header strings.
24 * @see Drupal\Core\Entity\EntityListController::render()
26 public function buildHeader() {
27 $header['label'] = $this->t('Migration Group');
28 $header['machine_name'] = $this->t('Machine Name');
29 $header['description'] = $this->t('Description');
30 $header['source_type'] = $this->t('Source Type');
31 return $header + parent::buildHeader();
35 * Builds a row for an entity in the entity listing.
37 * @param \Drupal\Core\Entity\EntityInterface $entity
38 * The entity for which to build the row.
41 * A render array of the table row for displaying the entity.
43 * @see \Drupal\Core\Entity\EntityListController::render()
45 public function buildRow(EntityInterface $entity) {
46 $row['label'] = $entity->label();
47 $row['machine_name'] = $entity->id();
48 $row['description'] = $entity->get('description');
49 $row['source_type'] = $entity->get('source_type');
51 return $row + parent::buildRow($entity);
57 public function getDefaultOperations(EntityInterface $entity) {
58 $operations = parent::getDefaultOperations($entity);
59 $operations['list'] = [
60 'title' => $this->t('List migrations'),
62 'url' => Url::fromRoute('entity.migration.list', ['migration_group' => $entity->id()]),