You are here

public function UserListBuilder::buildHeader in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/src/UserListBuilder.php \Drupal\user\UserListBuilder::buildHeader()
  2. 9 core/modules/user/src/UserListBuilder.php \Drupal\user\UserListBuilder::buildHeader()

Builds the header row for the entity listing.

Return value

array A render array structure of header strings.

Overrides EntityListBuilder::buildHeader

See also

\Drupal\Core\Entity\EntityListBuilder::render()

1 call to UserListBuilder::buildHeader()
UserListBuilder::load in core/modules/user/src/UserListBuilder.php
Loads entities of this type from storage for listing.

File

core/modules/user/src/UserListBuilder.php, line 82

Class

UserListBuilder
Defines a class to build a listing of user entities.

Namespace

Drupal\user

Code

public function buildHeader() {
  $header = [
    'username' => [
      'data' => $this
        ->t('Username'),
      'field' => 'name',
      'specifier' => 'name',
    ],
    'status' => [
      'data' => $this
        ->t('Status'),
      'field' => 'status',
      'specifier' => 'status',
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'roles' => [
      'data' => $this
        ->t('Roles'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'member_for' => [
      'data' => $this
        ->t('Member for'),
      'field' => 'created',
      'specifier' => 'created',
      'sort' => 'desc',
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'access' => [
      'data' => $this
        ->t('Last access'),
      'field' => 'access',
      'specifier' => 'access',
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
  ];
  return $header + parent::buildHeader();
}