Skip to content

Commit

Permalink
D11 followup for author entity list builder (see #3639).
Browse files Browse the repository at this point in the history
  • Loading branch information
joeparsons authored Aug 14, 2024
1 parent efafeb8 commit 569c3cd
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions modules/custom/az_publication/src/AZAuthorListBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,15 @@ class AZAuthorListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Author ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
protected const SORT_KEY = 'label';

/**
* {@inheritdoc}
*/
protected function getEntityListQuery() : QueryInterface {
// @todo In Drupal 11, replace this with usage of SORT_KEY.
$query = $this->getStorage()
->getQuery()
->accessCheck(TRUE)
->sort($this->entityType
->getKey('label'));
// Only add the pager if a limit is specified.
if ($this->limit) {
$query->pager($this->limit);
}
return $query;
public function buildHeader() {
$header['id'] = $this->t('Author ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}

/**
Expand Down

0 comments on commit 569c3cd

Please sign in to comment.