You are here

public function FixedBlockContentListBuilder::buildRow in Fixed Block Content 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/FixedBlockContentListBuilder.php, line 31

Class

FixedBlockContentListBuilder
Fixed block content list handler.

Namespace

Drupal\fixed_block_content

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\fixed_block_content\FixedBlockContentInterface $entity */
  $block_content = $entity
    ->getBlockContent(FALSE);
  $row = [
    'id' => $entity
      ->id(),
    'label' => $entity
      ->label(),
    'block_content_bundle' => $entity
      ->getBlockContentBundle(),
    'block_content' => $block_content ? $block_content
      ->toLink(NULL, 'canonical', [
      'query' => \Drupal::destination()
        ->getAsArray(),
    ]) : '-',
  ];
  return $row + parent::buildRow($entity);
}