class AssetListBuilder in farmOS 2.x
Defines a class to build a listing of asset entities.
Hierarchy
- class \Drupal\asset\AssetListBuilder extends \Drupal\entity\BulkFormEntityListBuilder
Expanded class hierarchy of AssetListBuilder
File
- modules/
core/ asset/ src/ AssetListBuilder.php, line 13
Namespace
Drupal\assetView source
class AssetListBuilder extends BulkFormEntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this
->t('Asset ID');
$header['label'] = $this
->t('Label');
$header['type'] = $this
->t('Type');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\asset\Entity\AssetInterface $entity */
$row['id'] = [
'#markup' => $entity
->id(),
];
$row['name'] = $entity
->toLink($entity
->label(), 'canonical')
->toRenderable();
$row['type'] = [
'#markup' => $entity
->getBundleLabel(),
];
return $row + parent::buildRow($entity);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AssetListBuilder:: |
public | function | ||
AssetListBuilder:: |
public | function |