@@ -41,8 +41,6 @@ class UpdateNodeInfo extends AbstractFeedback
41
41
*/
42
42
protected $ contentRepositoryRegistry ;
43
43
44
- protected bool $ isRecursive = false ;
45
-
46
44
protected ?string $ baseNodeType = null ;
47
45
48
46
public function setBaseNodeType (?string $ baseNodeType ): void
@@ -60,14 +58,6 @@ public function setNode(Node $node): void
60
58
$ this ->node = $ node ;
61
59
}
62
60
63
- /**
64
- * Update node infos recursively
65
- */
66
- public function recursive (): void
67
- {
68
- $ this ->isRecursive = true ;
69
- }
70
-
71
61
public function getNode (): Node
72
62
{
73
63
return $ this ->node ;
@@ -103,7 +93,7 @@ public function isSimilarTo(FeedbackInterface $feedback): bool
103
93
public function serializePayload (ControllerContext $ controllerContext ): array
104
94
{
105
95
return [
106
- 'byContextPath ' => $ this ->serializeNodeRecursively ($ this ->node , $ controllerContext ->getRequest ())
96
+ 'byContextPath ' => $ this ->serializeNode ($ this ->node , $ controllerContext ->getRequest ())
107
97
];
108
98
}
109
99
@@ -112,25 +102,13 @@ public function serializePayload(ControllerContext $controllerContext): array
112
102
*
113
103
* @return array<string,?array<string,mixed>>
114
104
*/
115
- private function serializeNodeRecursively (Node $ node , ActionRequest $ actionRequest ): array
105
+ private function serializeNode (Node $ node , ActionRequest $ actionRequest ): array
116
106
{
117
- $ contentRepository = $ this ->contentRepositoryRegistry ->get ($ node ->contentRepositoryId );
118
-
119
- $ result = [
120
- NodeAddress::fromNode ($ node )->toJson ()
121
- => $ this ->nodeInfoHelper ->renderNodeWithPropertiesAndChildrenInformation (
107
+ return [
108
+ NodeAddress::fromNode ($ node )->toJson () => $ this ->nodeInfoHelper ->renderNodeWithPropertiesAndChildrenInformation (
122
109
$ node ,
123
110
$ actionRequest
124
111
)
125
112
];
126
-
127
- if ($ this ->isRecursive === true ) {
128
- $ subgraph = $ this ->contentRepositoryRegistry ->subgraphForNode ($ node );
129
- foreach ($ subgraph ->findChildNodes ($ node ->aggregateId , FindChildNodesFilter::create ()) as $ childNode ) {
130
- $ result = array_merge ($ result , $ this ->serializeNodeRecursively ($ childNode , $ actionRequest ));
131
- }
132
- }
133
-
134
- return $ result ;
135
113
}
136
114
}
0 commit comments