You are here

NewsletterListBuilder.php in Simplenews 8

Same filename and directory in other branches
  1. 8.2 src/NewsletterListBuilder.php
  2. 3.x src/NewsletterListBuilder.php

Namespace

Drupal\simplenews

File

src/NewsletterListBuilder.php
View source
<?php

namespace Drupal\simplenews;

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

/**
 * Defines a class to build a listing of simplenews newsletter entities.
 *
 * @see \Drupal\simplenews\Entity\Newsletter
 */
class NewsletterListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['name'] = t('Newsletter name');
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {
    $row['name'] = $entity
      ->label();
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
NewsletterListBuilder Defines a class to build a listing of simplenews newsletter entities.