You are here

public function AuthorizationProfileListBuilder::buildRow in Authorization 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/AuthorizationProfileListBuilder.php, line 29

Class

AuthorizationProfileListBuilder
Provides a listing of Authorization profile entities.

Namespace

Drupal\authorization

Code

public function buildRow(EntityInterface $entity) : array {
  $row['label'] = $entity
    ->label();

  // @todo Abstract get[Provider|Consumer]Options() from the form into Entity
  // or as a trait so we can display the label of them here instead of the
  // machine name.
  $row['provider'] = $entity
    ->get('provider');
  $row['consumer'] = $entity
    ->get('consumer');
  $row['enabled'] = $entity
    ->get('status') ? 'Yes' : 'No';
  return $row + parent::buildRow($entity);
}