You are here

public function SimpleAccessGroupListBuilder::buildRow in Simple Access 8.3

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/SimpleAccessGroupListBuilder.php, line 38

Class

SimpleAccessGroupListBuilder
Provides Drupal\simple_access\Controller\SimpleAccessGroupListBuilder.

Namespace

Drupal\simple_access\Controller

Code

public function buildRow(EntityInterface $entity) {
  $row = [];
  $row['label'] = $entity
    ->label();
  $row['roles'] = [
    '#type' => 'markup',
    '#markup' => implode(', ', array_intersect_key(user_role_names(), array_filter($entity->roles))),
  ];
  return $row + parent::buildRow($entity);
}