You are here

public function SynonymListBuilder::buildHeader in Search API Synonym 8

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/SynonymListBuilder.php, line 59

Class

SynonymListBuilder
Defines a class to build a listing of Synonym entities.

Namespace

Drupal\search_api_synonym

Code

public function buildHeader() {
  $header = [
    'word' => $this
      ->t('Word'),
    'synonyms' => $this
      ->t('Synonyms'),
    'author' => [
      'data' => $this
        ->t('Author'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'status' => [
      'data' => $this
        ->t('Status'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'changed' => [
      'data' => $this
        ->t('Updated'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
  ];
  if (\Drupal::languageManager()
    ->isMultilingual()) {
    $header['language_name'] = [
      'data' => $this
        ->t('Language'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ];
  }
  return $header + parent::buildHeader();
}