public function QueueStorageEntityListBuilder::buildRow in Open Social 8.9
Same name and namespace in other branches
- 8.8 modules/custom/social_queue_storage/src/QueueStorageEntityListBuilder.php \Drupal\social_queue_storage\QueueStorageEntityListBuilder::buildRow()
- 10.3.x modules/custom/social_queue_storage/src/QueueStorageEntityListBuilder.php \Drupal\social_queue_storage\QueueStorageEntityListBuilder::buildRow()
- 10.0.x modules/custom/social_queue_storage/src/QueueStorageEntityListBuilder.php \Drupal\social_queue_storage\QueueStorageEntityListBuilder::buildRow()
- 10.1.x modules/custom/social_queue_storage/src/QueueStorageEntityListBuilder.php \Drupal\social_queue_storage\QueueStorageEntityListBuilder::buildRow()
- 10.2.x modules/custom/social_queue_storage/src/QueueStorageEntityListBuilder.php \Drupal\social_queue_storage\QueueStorageEntityListBuilder::buildRow()
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
- modules/
custom/ social_queue_storage/ src/ QueueStorageEntityListBuilder.php, line 30
Class
- QueueStorageEntityListBuilder
- Defines a class to build a listing of Queue storage entity entities.
Namespace
Drupal\social_queue_storageCode
public function buildRow(EntityInterface $entity) {
/* @var \Drupal\social_queue_storage\Entity\QueueStorageEntity $entity */
$row['id'] = $entity
->id();
$row['name'] = $entity
->bundle();
$row['owner'] = $entity
->getOwner()
->getDisplayName();
// Add a description.
$row_description = $entity
->label();
if ($entity
->bundle() === 'email') {
// When bundle is email, display the email subject.
$row_description = $entity
->get('field_subject')->value;
}
$row['description'] = Link::createFromRoute($row_description, 'entity.queue_storage_entity.canonical', [
'queue_storage_entity' => $entity
->id(),
]);
return $row + parent::buildRow($entity);
}