You are here

protected function NeutralPathAliasListBuilder::getEntityIds in Language neutral aliases 8.2

Same name and namespace in other branches
  1. 3.x src/NeutralPathAliasListBuilder.php \Drupal\language_neutral_aliases\NeutralPathAliasListBuilder::getEntityIds()

Loads entity IDs using a pager sorted by the entity id.

Return value

array An array of entity IDs.

Overrides PathAliasListBuilder::getEntityIds

File

src/NeutralPathAliasListBuilder.php, line 16

Class

NeutralPathAliasListBuilder
Extends path_alias list builder to only display neutral aliases.

Namespace

Drupal\language_neutral_aliases

Code

protected function getEntityIds() {
  $query = $this
    ->getStorage()
    ->getQuery();
  $search = $this->currentRequest->query
    ->get('search');
  $query
    ->condition('langcode', LanguageInterface::LANGCODE_NOT_SPECIFIED);
  if ($search) {
    $query
      ->condition('alias', $search, 'CONTAINS');
  }

  // Only add the pager if a limit is specified.
  if ($this->limit) {
    $query
      ->pager($this->limit);
  }

  // Allow the entity query to sort using the table header.
  $header = $this
    ->buildHeader();
  $query
    ->tableSort($header);
  return $query
    ->execute();
}