You are here

SimpleMegaMenuTypeListBuilder.php in Simple Mega Menu 2.0.x

Same filename and directory in other branches
  1. 8 src/SimpleMegaMenuTypeListBuilder.php

File

src/SimpleMegaMenuTypeListBuilder.php
View source
<?php

namespace Drupal\simple_megamenu;

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

/**
 * Provides a listing of Simple mega menu type entities.
 */
class SimpleMegaMenuTypeListBuilder extends ConfigEntityListBuilder {

  /**
   * {@inheritdoc}
   */
  public function buildHeader() {
    $header['label'] = $this
      ->t('Simple mega menu type');
    $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
SimpleMegaMenuTypeListBuilder Provides a listing of Simple mega menu type entities.