1 | <?php |
||
28 | class HierarchyFacet extends AbstractFacet |
||
29 | { |
||
30 | const TYPE_HIERARCHY = 'hierarchy'; |
||
31 | |||
32 | /** |
||
33 | * String |
||
34 | * @var string |
||
35 | */ |
||
36 | protected static $type = self::TYPE_HIERARCHY; |
||
37 | |||
38 | /** |
||
39 | * @var NodeCollection |
||
40 | */ |
||
41 | protected $childNodes; |
||
42 | |||
43 | /** |
||
44 | * @var NodeCollection |
||
45 | */ |
||
46 | protected $allNodes; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $nodesByKey = []; |
||
52 | |||
53 | /** |
||
54 | * OptionsFacet constructor |
||
55 | * |
||
56 | * @param SearchResultSet $resultSet |
||
57 | * @param string $name |
||
58 | * @param string $field |
||
59 | * @param string $label |
||
60 | * @param array $configuration Facet configuration passed from typoscript |
||
61 | */ |
||
62 | 31 | public function __construct(SearchResultSet $resultSet, $name, $field, $label = '', array $configuration = []) |
|
68 | |||
69 | /** |
||
70 | * @param Node $node |
||
71 | */ |
||
72 | 31 | public function addChildNode(Node $node) |
|
76 | |||
77 | /** |
||
78 | * @return NodeCollection |
||
79 | */ |
||
80 | 29 | public function getChildNodes() |
|
84 | |||
85 | /** |
||
86 | * Creates a new node on the right position with the right parent node. |
||
87 | * |
||
88 | * @param string $parentKey |
||
89 | * @param string $key |
||
90 | * @param string $label |
||
91 | * @param string $value |
||
92 | * @param integer $count |
||
93 | * @param boolean $selected |
||
94 | */ |
||
95 | 31 | public function createNode($parentKey, $key, $label, $value, $count, $selected) |
|
110 | |||
111 | /** |
||
112 | * Get facet partial name used for rendering the facet |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | 27 | public function getPartialName() |
|
120 | |||
121 | /** |
||
122 | * The implementation of this method should return a "flatten" collection of all items. |
||
123 | * |
||
124 | * @return AbstractFacetItemCollection |
||
125 | */ |
||
126 | 2 | public function getAllFacetItems() |
|
130 | } |
||
131 |