public function TokenCustomListBuilder::buildRow in Custom Tokens 8
Builds a row for an entity in the entity listing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.
Return value
array A render array structure of fields for this entity.
Overrides EntityListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
TokenCustomListBuilder.php, line 33
Class
- TokenCustomListBuilder
- Defines a class to build a listing of custom token entities.
Namespace
Drupal\token_customCode
public function buildRow(EntityInterface $entity) {
$row['machine_name'] = $entity
->id();
$row['type'] = $entity
->bundle();
$row['name'] = $entity
->label();
$row['description'] = $entity
->getDescription();
$row['content'] = $entity
->getRawContent();
return $row + parent::buildRow($entity);
}