AuthorizationProfileListBuilder.php in Authorization 8
File
src/AuthorizationProfileListBuilder.php
View source
<?php
declare (strict_types=1);
namespace Drupal\authorization;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
class AuthorizationProfileListBuilder extends ConfigEntityListBuilder {
public function buildHeader() : array {
$header['label'] = $this
->t('Profile');
$header['provider'] = $this
->t('Provider');
$header['consumer'] = $this
->t('Consumer');
$header['enabled'] = $this
->t('Enabled');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) : array {
$row['label'] = $entity
->label();
$row['provider'] = $entity
->get('provider');
$row['consumer'] = $entity
->get('consumer');
$row['enabled'] = $entity
->get('status') ? 'Yes' : 'No';
return $row + parent::buildRow($entity);
}
}