OpenIDConnectClientListBuilder.php in OpenID Connect / OAuth client 2.x
File
src/Controller/OpenIDConnectClientListBuilder.php
View source
<?php
namespace Drupal\openid_connect\Controller;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class OpenIDConnectClientListBuilder extends ConfigEntityListBuilder {
public function buildHeader() : array {
$header = [
'label' => [
'data' => $this
->t('OpenID Connect Client'),
'specifier' => 'label',
],
'type' => [
'data' => $this
->t('Type'),
],
'status' => [
'data' => $this
->t('Status'),
'specifier' => 'status',
'class' => [
RESPONSIVE_PRIORITY_LOW,
],
],
];
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) : array {
$plugin = $entity
->getPlugin();
$row['label'] = $entity
->label();
$row['type'] = $plugin
->getLabel();
$row['status'] = $entity
->status() ? $this
->t('Enabled') : $this
->t('Disabled');
return $row + parent::buildRow($entity);
}
}