You are here

public function AliasStorage::getAliasesForAdminListing in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Path/AliasStorage.php \Drupal\Core\Path\AliasStorage::getAliasesForAdminListing()

Loads aliases for admin listing.

Parameters

array $header: Table header.

string|null $keys: (optional) Search keyword that may include one or more '*' as wildcard values.

Return value

array Array of items to be displayed on the current page.

Overrides AliasStorageInterface::getAliasesForAdminListing

File

core/lib/Drupal/Core/Path/AliasStorage.php, line 259
Contains \Drupal\Core\Path\AliasStorage.

Class

AliasStorage
Provides a class for CRUD operations on path aliases.

Namespace

Drupal\Core\Path

Code

public function getAliasesForAdminListing($header, $keys = NULL) {
  $query = $this->connection
    ->select('url_alias')
    ->extend('Drupal\\Core\\Database\\Query\\PagerSelectExtender')
    ->extend('Drupal\\Core\\Database\\Query\\TableSortExtender');
  if ($keys) {

    // Replace wildcards with PDO wildcards.
    $query
      ->condition('alias', '%' . preg_replace('!\\*+!', '%', $keys) . '%', 'LIKE');
  }
  return $query
    ->fields('url_alias')
    ->orderByHeader($header)
    ->limit(50)
    ->execute()
    ->fetchAll();
}