You are here

public function FlagListBuilder::buildRow in Flag 8.4

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 DraggableListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/Controller/FlagListBuilder.php, line 120

Class

FlagListBuilder
Provides a entity list page for Flags.

Namespace

Drupal\flag\Controller

Code

public function buildRow(EntityInterface $entity) {
  $row['label'] = $entity
    ->label();
  $row['flag_type'] = $this
    ->getFlagType($entity);
  $row['roles'] = $this
    ->getFlagRoles($entity);
  $row['bundles'] = $this
    ->getBundles($entity);
  $row['global'] = [
    '#markup' => $entity
      ->isGlobal() ? $this
      ->t('Global') : $this
      ->t('Personal'),
  ];
  $row['status'] = [
    '#markup' => $entity
      ->status() ? $this
      ->t('Enabled') : $this
      ->t('Disabled'),
  ];
  return $row + parent::buildRow($entity);
}