ExampleConfigEntityListBuilder.php in Chaos Tool Suite (ctools) 8.3
File
tests/modules/ctools_wizard_test/src/ExampleConfigEntityListBuilder.php
View source
<?php
namespace Drupal\ctools_wizard_test;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class ExampleConfigEntityListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['label'] = $this
->t('Example config entity');
$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 getOperations(EntityInterface $entity) {
$operations = parent::getOperations($entity);
if (!empty($operations['edit'])) {
$edit = $operations['edit']['url'];
$edit
->setRouteParameters([
'machine_name' => $entity
->id(),
'step' => 'general',
]);
}
return $operations;
}
}