You are here

public function CivicrmEntityListBuilder::buildHeader in CiviCRM Entity 8.3

Builds the header row for the entity listing.

Return value

array A render array structure of header strings.

Overrides EntityListBuilder::buildHeader

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/CivicrmEntityListBuilder.php, line 16

Class

CivicrmEntityListBuilder

Namespace

Drupal\civicrm_entity

Code

public function buildHeader() {
  if ($this->entityType
    ->hasKey('bundle')) {
    return [
      'id' => $this
        ->t('ID'),
      'bundle' => $this->entityType
        ->getBundleLabel(),
      'label' => $this
        ->t('Label'),
    ] + parent::buildHeader();
  }
  return [
    'id' => $this
      ->t('ID'),
    'label' => $this
      ->t('Label'),
  ] + parent::buildHeader();
}