You are here

interface SearchApiSortsManagerInterface in Search API sorts 8

Defines the interface for the search api sort manager.

Hierarchy

Expanded class hierarchy of SearchApiSortsManagerInterface

All classes that implement SearchApiSortsManagerInterface

1 file declares its use of SearchApiSortsManagerInterface
SearchApiSortsQueryPreExecute.php in src/EventSubscriber/SearchApiSortsQueryPreExecute.php

File

src/SearchApiSortsManagerInterface.php, line 11

Namespace

Drupal\search_api_sorts
View source
interface SearchApiSortsManagerInterface {

  /**
   * Returns the active sort field and order for a given search api display.
   *
   * @param \Drupal\search_api\Display\DisplayInterface $display
   *   The display where the active sort should be returned for.
   *
   * @return \Drupal\search_api_sorts\SortsField
   *   An object containing the field and order.
   */
  public function getActiveSort(DisplayInterface $display);

  /**
   * Returns the default sort field and order.
   *
   * @param \Drupal\search_api\Display\DisplayInterface $display
   *   The display where the default sort should be returned for.
   *
   * @return \Drupal\search_api_sorts\SortsField
   *   An object containing the field and order.
   */
  public function getDefaultSort(DisplayInterface $display);

  /**
   * Returns all enabled sort fields for a given search api display.
   *
   * @param \Drupal\search_api\Display\DisplayInterface $display
   *   The display where the enabled sorts should be returned for.
   *
   * @return \Drupal\search_api_sorts\Entity\SearchApiSortsField[]
   *   An array of sort field entities.
   */
  public function getEnabledSorts(DisplayInterface $display);

  /**
   * Remove all deleted sorts for the given index.
   *
   * @param \Drupal\search_api\IndexInterface $index
   *   The search api index.
   */
  public function cleanupSortFields(IndexInterface $index);

}

Members

Namesort descending Modifiers Type Description Overrides
SearchApiSortsManagerInterface::cleanupSortFields public function Remove all deleted sorts for the given index. 1
SearchApiSortsManagerInterface::getActiveSort public function Returns the active sort field and order for a given search api display. 1
SearchApiSortsManagerInterface::getDefaultSort public function Returns the default sort field and order. 1
SearchApiSortsManagerInterface::getEnabledSorts public function Returns all enabled sort fields for a given search api display. 1