We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d79c92c commit b530a2fCopy full SHA for b530a2f
1 file changed
Classes/Domain/Search/ResultSet/Facets/OptionBased/Hierarchy/Node.php
@@ -22,7 +22,7 @@
22
*/
23
class Node extends AbstractOptionFacetItem
24
{
25
- protected int $depth;
+ protected int $depth = 0;
26
27
public function __construct(
28
HierarchyFacet $facet,
@@ -41,6 +41,10 @@ public function __construct(
41
$documentCount,
42
$selected,
43
);
44
+
45
+ if ($parentNode) {
46
+ $this->depth = $parentNode->getDepth() + 1;
47
+ }
48
}
49
50
public function getKey(): string
@@ -68,6 +72,11 @@ public function getHasParentNode(): bool
68
72
return $this->parentNode !== null;
69
73
70
74
75
+ public function getDepth(): int
76
+ {
77
+ return $this->depth;
78
79
71
80
public function getHasChildNodeSelected(): bool
81
82
/** @var Node $childNode */
0 commit comments