You are here

public function ConfigTranslationBlockListBuilder::buildRow in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config_translation/src/Controller/ConfigTranslationBlockListBuilder.php \Drupal\config_translation\Controller\ConfigTranslationBlockListBuilder::buildRow()

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides ConfigTranslationEntityListBuilder::buildRow

See also

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

File

core/modules/config_translation/src/Controller/ConfigTranslationBlockListBuilder.php, line 57

Class

ConfigTranslationBlockListBuilder
Defines the config translation list builder for blocks.

Namespace

Drupal\config_translation\Controller

Code

public function buildRow(EntityInterface $entity) {
  $theme = $entity
    ->getTheme();
  $plugin_definition = $entity
    ->getPlugin()
    ->getPluginDefinition();
  $row['label'] = [
    'data' => $entity
      ->label(),
    'class' => 'table-filter-text-source',
  ];
  $row['theme'] = [
    'data' => $this->themes[$theme]->info['name'],
    'class' => 'table-filter-text-source',
  ];
  $row['category'] = [
    'data' => $plugin_definition['category'],
    'class' => 'table-filter-text-source',
  ];
  $row['operations']['data'] = $this
    ->buildOperations($entity);
  return $row;
}