Skip to content

FEATURE: implement list and prune commands for all user workspaces#2

Open
Xathos1991 wants to merge 3 commits intopunktDe:masterfrom
Xathos1991:feature/list_and_prune_all_user_workspaces
Open

FEATURE: implement list and prune commands for all user workspaces#2
Xathos1991 wants to merge 3 commits intopunktDe:masterfrom
Xathos1991:feature/list_and_prune_all_user_workspaces

Conversation

@Xathos1991
Copy link
Copy Markdown

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

…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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier ist ein typo in "nodes"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants