PlanListBuilder.php in farmOS 2.x
File
modules/core/plan/src/PlanListBuilder.php
View source
<?php
namespace Drupal\plan;
use Drupal\Core\Entity\EntityInterface;
use Drupal\entity\BulkFormEntityListBuilder;
class PlanListBuilder extends BulkFormEntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Plan ID');
$header['label'] = $this
->t('Label');
$header['type'] = $this
->t('Type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = [
'#markup' => $entity
->id(),
];
$row['name'] = $entity
->toLink($entity
->label(), 'canonical')
->toRenderable();
$row['type'] = [
'#markup' => $entity
->getBundleLabel(),
];
return $row + parent::buildRow($entity);
}
}