Version 1
[yaffs-website] / web / core / modules / search / src / SearchPageRepositoryInterface.php
1 <?php
2
3 namespace Drupal\search;
4
5 /**
6  * Provides the interface for a repository Search Page entities.
7  */
8 interface SearchPageRepositoryInterface {
9
10   /**
11    * Returns all active search page entities.
12    *
13    * @return \Drupal\search\SearchPageInterface[]
14    *   An array of active search page entities.
15    */
16   public function getActiveSearchPages();
17
18   /**
19    * Returns whether search is active.
20    *
21    * @return bool
22    *   TRUE if at least one search is active, FALSE otherwise.
23    */
24   public function isSearchActive();
25
26   /**
27    * Returns all active, indexable search page entities.
28    *
29    * @return \Drupal\search\SearchPageInterface[]
30    *   An array of indexable search page entities.
31    */
32   public function getIndexableSearchPages();
33
34   /**
35    * Returns the default search page.
36    *
37    * @return \Drupal\search\SearchPageInterface|bool
38    *   The search page entity, or FALSE if no pages are active.
39    */
40   public function getDefaultSearchPage();
41
42   /**
43    * Sets a given search page as the default.
44    *
45    * @param \Drupal\search\SearchPageInterface $search_page
46    *   The search page entity.
47    *
48    * @return static
49    */
50   public function setDefaultSearchPage(SearchPageInterface $search_page);
51
52   /**
53    * Clears the default search page.
54    */
55   public function clearDefaultSearchPage();
56
57   /**
58    * Sorts a list of search pages.
59    *
60    * @param \Drupal\search\SearchPageInterface[] $search_pages
61    *   The unsorted list of search pages.
62    *
63    * @return \Drupal\search\SearchPageInterface[]
64    *   The sorted list of search pages.
65    */
66   public function sortSearchPages($search_pages);
67
68 }