You are here

public function ClientListBuilder::buildRow in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/ClientListBuilder.php \Drupal\oauth2_server\ClientListBuilder::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()

1 call to ClientListBuilder::buildRow()
ClientListBuilder::render in src/ClientListBuilder.php

File

src/ClientListBuilder.php, line 53

Class

ClientListBuilder
Builds a listing of oauth2 server client entities.

Namespace

Drupal\oauth2_server

Code

public function buildRow(EntityInterface $entity) {

  /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
  $row = parent::buildRow($entity);
  return [
    'data' => [
      'label' => [
        'data' => $entity
          ->label(),
        'class' => [
          'oauth2-server-client-name',
        ],
      ],
      'operations' => $row['operations'],
    ],
    'title' => $this
      ->t('ID: @name', [
      '@name' => $entity
        ->id(),
    ]),
    'class' => [
      Html::cleanCssIdentifier($entity
        ->getEntityTypeId() . '-' . $entity
        ->id()),
    ],
  ];
}