You are here

ConsentAgreementListBuilder.php in General Data Protection Regulation 3.0.x

File

modules/gdpr_consent/src/Entity/ConsentAgreementListBuilder.php
View source
<?php

namespace Drupal\gdpr_consent\Entity;

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;

/**
 * Provides a list controller for gdpr_consent entities.
 *
 * @ingroup gdpr_consent
 */
class ConsentAgreementListBuilder extends EntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header = [
      'title' => $this
        ->t('Title'),
      'mode' => $this
        ->t('Implicit/Explicit'),
    ];
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row = [
      'title' => $entity
        ->get('title')->value,
      'mode' => $entity
        ->get('mode')->value,
    ];
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
ConsentAgreementListBuilder Provides a list controller for gdpr_consent entities.