ApiKeyListBuilder.php in Services API Key Authentication 2.0.x
File
src/Controller/ApiKeyListBuilder.php
View source
<?php
namespace Drupal\services_api_key_auth\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class ApiKeyListBuilder extends ConfigEntityListBuilder {
public function buildHeader() {
$header['id'] = $this
->t('Machine name');
$header['key'] = $this
->t('API Key');
$header['user_uuid'] = $this
->t('User UUID');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
$row['key'] = $entity->key;
$row['user_uuid'] = $entity->user_uuid;
return $row + parent::buildRow($entity);
}
}