Repository URL to install this package:
|
Version:
0.19.1 ▾
|
<?php
namespace Drupal\dds_maps;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
/**
* Defines a class to build a listing of Map entities.
*
* @ingroup dds_maps
*/
class MapListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Map ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\dds_maps\Entity\Map */
$row['id'] = $entity->id();
$row['name'] = Link::createFromRoute(
$entity->label(),
'entity.map.edit_form',
['map' => $entity->id()]
);
return $row + parent::buildRow($entity);
}
}