DeploymentListBuilder.php in Build Hooks 8.2
File
src/DeploymentListBuilder.php
View source
<?php
namespace Drupal\build_hooks;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
class DeploymentListBuilder extends EntityListBuilder {
public function buildHeader() {
return [
'label' => $this
->t('Label'),
'environment' => $this
->t('Environment'),
'status' => $this
->t('Status'),
] + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
return [
'label' => $entity
->label(),
'environment' => $entity
->bundle(),
'status' => $entity
->isDeployed() ? $this
->t('Deployed') : $this
->t('Pending'),
] + parent::buildRow($entity);
}
}