public function SearchPageRepository::sortSearchPages in Drupal 9
Same name and namespace in other branches
- 8 core/modules/search/src/SearchPageRepository.php \Drupal\search\SearchPageRepository::sortSearchPages()
Sorts a list of search pages.
Parameters
\Drupal\search\SearchPageInterface[] $search_pages: The unsorted list of search pages.
Return value
\Drupal\search\SearchPageInterface[] The sorted list of search pages.
Overrides SearchPageRepositoryInterface::sortSearchPages
File
- core/
modules/ search/ src/ SearchPageRepository.php, line 106
Class
- SearchPageRepository
- Provides a repository for Search Page config entities.
Namespace
Drupal\searchCode
public function sortSearchPages($search_pages) {
$entity_type = $this->storage
->getEntityType();
uasort($search_pages, [
$entity_type
->getClass(),
'sort',
]);
return $search_pages;
}