LayoutBuilderStyleListBuilder.php in Layout Builder Styles 8
File
src/LayoutBuilderStyleListBuilder.php
View source
<?php
namespace Drupal\layout_builder_styles;
use Drupal\Core\Config\Entity\DraggableListBuilder;
use Drupal\Core\Entity\EntityInterface;
class LayoutBuilderStyleListBuilder extends DraggableListBuilder {
public function getFormId() {
return 'layout_builder_styles_admin_overview_form';
}
public function buildHeader() {
$header['label'] = $this
->t('Label');
$header['id'] = $this
->t('Machine name');
$header['type'] = $this
->t('Type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row = [];
$row['label'] = $entity
->label();
$row['id'] = [
'#plain_text' => $entity
->id(),
];
$row['type'] = [
'#plain_text' => $entity
->getType(),
];
return $row + parent::buildRow($entity);
}
}