Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (28 sloc) 815 Bytes
<?php
namespace Drupal\practical;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
/**
* Class PracticalTypeListBuilder
*/
class PracticalTypeListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader(){
$header['label'] = $this->t('Label');
$header['description'] = $this->t('Description');
$header['id'] = $this->t('Machine name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\practical\Entity\PracticalTypeEntityInterface $entity */
$row['label'] = $entity->label();
$row['description'] = $entity->getDescription();
$row['id'] = $entity->id();
return $row + parent::buildRow($entity);
}
}