1 | <?php |
||
25 | abstract class AbstractFacet |
||
26 | { |
||
27 | const TYPE_ABSTRACT = 'abstract'; |
||
28 | |||
29 | /** |
||
30 | * String |
||
31 | * @var string |
||
32 | */ |
||
33 | protected static $type = self::TYPE_ABSTRACT; |
||
34 | |||
35 | /** |
||
36 | * The resultSet where this facet belongs to. |
||
37 | * |
||
38 | * @var SearchResultSet |
||
39 | */ |
||
40 | protected $resultSet = null; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $name; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $field; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $label; |
||
56 | |||
57 | /** |
||
58 | * @var [] |
||
59 | */ |
||
60 | protected $configuration; |
||
61 | |||
62 | /** |
||
63 | * @var boolean |
||
64 | */ |
||
65 | protected $isAvailable = false; |
||
66 | |||
67 | /** |
||
68 | * @var bool |
||
69 | */ |
||
70 | protected $isUsed = false; |
||
71 | |||
72 | /** |
||
73 | * AbstractFacet constructor. |
||
74 | * |
||
75 | * @param SearchResultSet $resultSet |
||
76 | * @param string $name |
||
77 | * @param string $field |
||
78 | * @param string $label |
||
79 | * @param array $configuration Facet configuration passed from typoscript |
||
80 | */ |
||
81 | public function __construct(SearchResultSet $resultSet, $name, $field, $label = '', array $configuration = []) |
||
89 | |||
90 | /** |
||
91 | * Get name |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | public function getName() |
||
99 | |||
100 | /** |
||
101 | * Get solr field name |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getField() |
||
109 | |||
110 | /** |
||
111 | * @param string $label |
||
112 | */ |
||
113 | public function setLabel($label) |
||
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getLabel() |
||
125 | |||
126 | /** |
||
127 | * @param boolean $isAvailable |
||
128 | */ |
||
129 | public function setIsAvailable($isAvailable) |
||
133 | |||
134 | /** |
||
135 | * @return boolean |
||
136 | */ |
||
137 | public function getIsAvailable() |
||
141 | |||
142 | /** |
||
143 | * @param boolean $isUsed |
||
144 | */ |
||
145 | public function setIsUsed($isUsed) |
||
149 | |||
150 | /** |
||
151 | * @return boolean |
||
152 | */ |
||
153 | public function getIsUsed() |
||
157 | |||
158 | /** |
||
159 | * @return string |
||
160 | */ |
||
161 | public function getType() |
||
165 | |||
166 | /** |
||
167 | * @return SearchResultSet |
||
168 | */ |
||
169 | public function getResultSet() |
||
173 | |||
174 | /** |
||
175 | * Get configuration |
||
176 | * |
||
177 | * @return mixed |
||
178 | */ |
||
179 | public function getConfiguration() |
||
183 | |||
184 | /** |
||
185 | * Get facet partial name used for rendering the facet |
||
186 | * |
||
187 | * @return string |
||
188 | */ |
||
189 | public function getPartialName() |
||
193 | |||
194 | /** |
||
195 | * @return string |
||
196 | */ |
||
197 | public function getGroupName() |
||
201 | |||
202 | /** |
||
203 | * The implementation of this method should return a "flatten" collection of all items. |
||
204 | * |
||
205 | * @return AbstractFacetItemCollection |
||
206 | */ |
||
207 | abstract public function getAllFacetItems(); |
||
208 | } |
||
209 |