You are here

public function PagererPresetListBuilder::buildRow in Pagerer 8

Same name and namespace in other branches
  1. 8.2 src/PagererPresetListBuilder.php \Drupal\pagerer\PagererPresetListBuilder::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

src/PagererPresetListBuilder.php, line 26

Class

PagererPresetListBuilder
Provides a listing of Pagerer presets.

Namespace

Drupal\pagerer

Code

public function buildRow(EntityInterface $entity) {
  $row['name'] = $entity
    ->label();
  $row['preview']['class'] = [
    'pagerer-admin-preset-preview',
  ];
  $row['preview']['data'] = [
    '#type' => 'pager',
    '#theme' => 'pagerer',
    '#element' => 5,
    '#config' => [
      'preset' => $entity
        ->id(),
    ],
  ];
  return $row + parent::buildRow($entity);
}