You are here

CookiesServiceGroupListBuilder.php in COOKiES Consent Management 1.0.x

Namespace

Drupal\cookies

File

src/CookiesServiceGroupListBuilder.php
View source
<?php

namespace Drupal\cookies;

use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;

/**
 * Provides a listing of Cookie service group entities.
 */
class CookiesServiceGroupListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('COOKiES service group');
    $header['id'] = $this
      ->t('Machine name');
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['label'] = $entity
      ->label();
    $row['id'] = $entity
      ->id();

    // You probably want a few more properties here...
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
CookiesServiceGroupListBuilder Provides a listing of Cookie service group entities.