HeartbeatListBuilder.php in Heartbeat 8
File
src/HeartbeatListBuilder.php
View source
<?php
namespace Drupal\heartbeat;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Routing\LinkGeneratorTrait;
use Drupal\Core\Url;
class HeartbeatListBuilder extends EntityListBuilder {
use LinkGeneratorTrait;
public function buildHeader() {
$header['id'] = $this
->t('Heartbeat 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.heartbeat.edit_form', array(
'heartbeat' => $entity
->id(),
)));
return $row + parent::buildRow($entity);
}
}