SimplemetaEntityListBuilder.php in Simple Meta 8
File
src/SimplemetaEntityListBuilder.php
View source
<?php
namespace Drupal\simplemeta;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Routing\LinkGeneratorTrait;
use Drupal\Core\Url;
class SimplemetaEntityListBuilder extends EntityListBuilder {
use LinkGeneratorTrait;
public function buildHeader() {
$header['id'] = $this
->t('SimpleMeta ID');
$header['name'] = $this
->t('Name');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
$row['name'] = $this
->l($entity
->label(), new Url('entity.simplemeta.edit_form', array(
'simplemeta' => $entity
->id(),
)));
return $row + parent::buildRow($entity);
}
}