You are here

SpamicideListBuilder.php in Spamicide 8

Namespace

Drupal\spamicide

File

src/SpamicideListBuilder.php
View source
<?php

namespace Drupal\spamicide;

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

/**
 * Provides a listing of spamicides.
 */
class SpamicideListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('Label');
    $header['id'] = $this
      ->t('Form ID');
    $header['status'] = $this
      ->t('Status');
    return $header + parent::buildHeader();
  }

  /**
   * {@inheritdoc}
   */
  public function buildRow(EntityInterface $entity) {

    /** @var \Drupal\spamicide\SpamicideInterface $entity */
    $row['label'] = $entity
      ->label();
    $row['id'] = $entity
      ->id();
    $row['status'] = $entity
      ->status() ? $this
      ->t('Enabled') : $this
      ->t('Disabled');
    return $row + parent::buildRow($entity);
  }

}

Classes

Namesort descending Description
SpamicideListBuilder Provides a listing of spamicides.