AssetListBuilder.php in farmOS 2.x
File
modules/core/asset/src/AssetListBuilder.php
View source
<?php
namespace Drupal\asset;
use Drupal\Core\Entity\EntityInterface;
use Drupal\entity\BulkFormEntityListBuilder;
class AssetListBuilder extends BulkFormEntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Asset ID');
$header['label'] = $this
->t('Label');
$header['type'] = $this
->t('Type');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = [
'#markup' => $entity
->id(),
];
$row['name'] = $entity
->toLink($entity
->label(), 'canonical')
->toRenderable();
$row['type'] = [
'#markup' => $entity
->getBundleLabel(),
];
return $row + parent::buildRow($entity);
}
}