You are here

class LogListBuilder in Log entity 2.x

Same name and namespace in other branches
  1. 8 src/LogListBuilder.php \Drupal\log\LogListBuilder

Defines a class to build a listing of Log entities.

Hierarchy

  • class \Drupal\log\LogListBuilder extends \Drupal\entity\BulkFormEntityListBuilder

Expanded class hierarchy of LogListBuilder

File

src/LogListBuilder.php, line 13

Namespace

Drupal\log
View source
class LogListBuilder extends BulkFormEntityListBuilder {

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

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

    /** @var \Drupal\log\Entity\LogInterface $entity */
    $row['id'] = [
      '#markup' => $entity
        ->id(),
    ];
    $row['name'] = $entity
      ->toLink($entity
      ->label(), 'canonical')
      ->toRenderable();
    $row['type'] = [
      '#markup' => $entity
        ->getBundleLabel(),
    ];
    return $row + parent::buildRow($entity);
  }

}

Members