3 namespace Drupal\fontyourface;
5 use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
6 use Drupal\Core\Entity\EntityInterface;
7 use Drupal\fontyourface\Entity\Font;
10 * Provides a listing of Font display entities.
12 class FontDisplayListBuilder extends ConfigEntityListBuilder {
17 public function buildHeader() {
18 $header['label'] = $this->t('Font display');
19 $header['id'] = $this->t('Machine name');
20 $header['name'] = $this->t('Font');
21 $header['theme'] = $this->t('Theme');
22 return $header + parent::buildHeader();
28 public function buildRow(EntityInterface $entity) {
29 $font = $entity->getFont();
31 $font = Font::create(['name' => 'Font not supported!']);
34 $row['label'] = $entity->label();
35 $row['id'] = $entity->id();
36 $row['name'] = $font->name->value;
37 $row['theme'] = $entity->getTheme();
38 return $row + parent::buildRow($entity);