You are here

public function EntityQueueListBuilder::buildRow in Entityqueue 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()

1 call to EntityQueueListBuilder::buildRow()
EntityQueueListBuilder::render in src/EntityQueueListBuilder.php
Builds the entity listing as renderable array for table.html.twig.

File

src/EntityQueueListBuilder.php, line 93

Class

EntityQueueListBuilder
Defines a class that builds a listing of entity queues.

Namespace

Drupal\entityqueue

Code

public function buildRow(EntityInterface $entity) {
  assert($entity instanceof EntityQueueInterface);
  $row = [
    'data' => [
      'label' => $entity
        ->label(),
      'target_type' => $this->entityTypeManager
        ->getDefinition($entity
        ->getTargetEntityTypeId())
        ->getLabel(),
      'handler' => $entity
        ->getHandlerPlugin()
        ->getPluginDefinition()['title'],
      'items' => $this
        ->getQueueItemsStatus($entity),
    ] + parent::buildRow($entity),
    'title' => $this
      ->t('Machine name: @name', [
      '@name' => $entity
        ->id(),
    ]),
  ];
  return $row;
}