2121
2222namespace WikibaseSolutions \CypherDSL \Clauses ;
2323
24- use WikibaseSolutions \CypherDSL \Types \AnyType ;
25- use WikibaseSolutions \CypherDSL \Types \StructuralTypes \NodeType ;
24+ use WikibaseSolutions \CypherDSL \Variable ;
2625
2726/**
2827 * This class represents a DELETE clause.
@@ -39,11 +38,11 @@ class DeleteClause extends Clause
3938 private bool $ detach = false ;
4039
4140 /**
42- * The nodes that needs to be deleted.
41+ * The variables that needs to be deleted.
4342 *
44- * @var AnyType [] $nodes
43+ * @var Variable [] $variables
4544 */
46- private array $ nodes = [];
45+ private array $ variables = [];
4746
4847 /**
4948 * Sets the clause to DETACH DELETE. Without DETACH DELETE, all relationships need to be explicitly
@@ -60,14 +59,14 @@ public function setDetach(bool $detach = true): self
6059 }
6160
6261 /**
63- * Add the node to be deleted. The expression must return a node when evaluated.
62+ * Add the variable to be deleted. The expression must return a node when evaluated.
6463 *
65- * @param NodeType $node Expression that returns the node to be deleted
64+ * @param Variable $variable The name of the object that should be deleted
6665 * @return DeleteClause
6766 */
68- public function addNode ( NodeType $ node ): self
67+ public function addVariable ( Variable $ variable ): self
6968 {
70- $ this ->nodes [] = $ node ;
69+ $ this ->variables [] = $ variable ;
7170
7271 return $ this ;
7372 }
@@ -83,13 +82,13 @@ public function detachesDeletion(): bool
8382 }
8483
8584 /**
86- * Returns the nodes to delete.
85+ * Returns the variables to delete.
8786 *
88- * @return AnyType []
87+ * @return Variable []
8988 */
90- public function getNodes (): array
89+ public function getVariables (): array
9190 {
92- return $ this ->nodes ;
91+ return $ this ->variables ;
9392 }
9493
9594 /**
@@ -111,7 +110,7 @@ protected function getSubject(): string
111110 {
112111 return implode (
113112 ", " ,
114- array_map (fn (NodeType $ node ) => $ node ->toQuery (), $ this ->nodes )
113+ array_map (fn (Variable $ variable ) => $ variable ->toQuery (), $ this ->variables )
115114 );
116115 }
117116}
0 commit comments