commerce-8.x-2.8/modules/tax/src/TaxTypeListBuilder.php
modules/tax/src/TaxTypeListBuilder.php
<?php
namespace Drupal\commerce_tax;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
/**
* Defines the list builder for tax types.
*/
class TaxTypeListBuilder extends ConfigEntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['label'] = $this->t('Tax type');
$header['status'] = $this->t('Status');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\commerce_tax\Entity\TaxTypeInterface $entity */
$row['label'] = $entity->label();
$row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
return $row + parent::buildRow($entity);
}
}
