You are here

public function SearchApiSortsManager::getEnabledSorts in Search API sorts 8

Returns all enabled sort fields for a given search api display.

Parameters

\Drupal\search_api\Display\DisplayInterface $display: The display where the enabled sorts should be returned for.

Return value

\Drupal\search_api_sorts\Entity\SearchApiSortsField[] An array of sort field entities.

Overrides SearchApiSortsManagerInterface::getEnabledSorts

1 call to SearchApiSortsManager::getEnabledSorts()
SearchApiSortsManager::getDefaultSort in src/SearchApiSortsManager.php
Returns the default sort field and order.

File

src/SearchApiSortsManager.php, line 82

Class

SearchApiSortsManager
Manages search api sorts.

Namespace

Drupal\search_api_sorts

Code

public function getEnabledSorts(DisplayInterface $display) {
  return $this->searchApiSortsFieldStorage
    ->loadByProperties([
    'status' => TRUE,
    'display_id' => $this
      ->getEscapedConfigId($display
      ->getPluginId()),
  ]);
}