1 | <?php |
||
35 | class SearchComponentManager |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * Search component registry. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected static $searchComponents = []; |
||
44 | |||
45 | /** |
||
46 | * Registers a search component. |
||
47 | * |
||
48 | * @param string $componentName Search component name |
||
49 | * @param string $componentClassName Component class |
||
50 | */ |
||
51 | 220 | public static function registerSearchComponent( |
|
57 | |||
58 | /** |
||
59 | * Returns all currently registered search components. |
||
60 | * |
||
61 | * @return array An array of search component instances |
||
62 | */ |
||
63 | 32 | public function getSearchComponents() |
|
73 | |||
74 | /** |
||
75 | * Instanciates a registered search component |
||
76 | * |
||
77 | * @param string $componentName Search component name |
||
78 | * @return SearchComponent Instance of the requested search component |
||
79 | * @throws \InvalidArgumentException if $componentName is not a registered search component |
||
80 | * @throws \RuntimeException if the class registered for $componentName is not an implementation of ApacheSolrForTypo3\Solr\Search\SearchComponent |
||
81 | */ |
||
82 | 32 | public function getSearchComponent($componentName) |
|
102 | |||
103 | /** |
||
104 | * Unregisters a search component |
||
105 | * |
||
106 | * @param string $componentName Search component name |
||
107 | */ |
||
108 | public function removeSearchComponent($componentName) |
||
116 | } |
||
117 |