FEATURE: implement list and prune commands for all user workspaces#2
FEATURE: implement list and prune commands for all user workspaces#2Xathos1991 wants to merge 3 commits intopunktDe:masterfrom
Conversation
…mplement instanceof NodeInterface check in command and convertNodesToNodeInfo functions due to the possibility of null values in the ArrayCollections
| * @param string $type | ||
| * @return ArrayCollection | ||
| */ | ||
| public function listOrphanNodeData(string $workspaceName, ?string $dimensions = null, $type = 'Neos.Neos:Document'): ArrayCollection |
There was a problem hiding this comment.
Der Methodenname ist irreführend. Hier sollte erkennbar sein, dass nur die nodeDatas zurückkommen, die internal sind bzw. aus denen keine Node erstellt werden konnte.
| $context = $this->createContextMatchingNodeData($nodeData); | ||
| $node = $this->nodeFactory->createFromNodeData($nodeData, $context); | ||
|
|
||
| return !$node instanceof NodeInterface; |
There was a problem hiding this comment.
Ich glaub diesen komplexen check braucht es hier nicht. Wenn es wirklich um internal nodes geht, dann kannst Du einfach auf $nodeData->isInternal() checken, so wie es die NodeFactory auch tut.
| */ | ||
| public function pruneAllCommand(string $workspace = 'live', ?string $dimensions = null, string $type = 'Neos.Neos:Document'): void | ||
| { | ||
| $orphanNodeData = $this->orphanNodeService->listOrphanNodeData($workspace, $dimensions, $type); |
There was a problem hiding this comment.
Ich weiß, das ist spitzfindig, aber ich finde es übersichtlicher, wenn das erst in Zeile 133 geholt würde, dann wenn es gebraucht wird. Durch die Reihenfolge wie es hier ist, suggeriert das irgendwie, dass diese $orphanNodeData-Variable für den folgenden Block ($this->command) genutzt würde
| * List orphan documents for all user workspaces | ||
| * | ||
| * @param string|null $dimensions The dimension combination as json representation, defaults to all dimensions | ||
| * @param string $type The supertype of the nods to search |
FEATURE: implement list and prune commands for all user workspaces, implement instanceof NodeInterface check in command and convertNodesToNodeInfo functions due to the possibility of null values in the ArrayCollections