File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 2222 */
2323class Node extends AbstractOptionFacetItem
2424{
25- protected int $ depth ;
25+ protected int $ depth = 0 ;
2626
2727 public function __construct (
2828 HierarchyFacet $ facet ,
@@ -41,6 +41,10 @@ public function __construct(
4141 $ documentCount ,
4242 $ selected ,
4343 );
44+
45+ if ($ parentNode ) {
46+ $ this ->depth = $ parentNode ->getDepth () + 1 ;
47+ }
4448 }
4549
4650 public function getKey (): string
@@ -68,6 +72,11 @@ public function getHasParentNode(): bool
6872 return $ this ->parentNode !== null ;
6973 }
7074
75+ public function getDepth (): int
76+ {
77+ return $ this ->depth ;
78+ }
79+
7180 public function getHasChildNodeSelected (): bool
7281 {
7382 /** @var Node $childNode */
You can’t perform that action at this time.
0 commit comments