-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support native cloning of Base objects #58
Comments
The vertex ID is currently unique within the whole graph. This means that we can not create an exact clone of the vertex within the same graph. This is what currently blocks this ticket. In the linked PR #89 @clemens-tolboom suggested assigning a new vertex ID when cloning a As an alternative, ticket #131 questions whether we actually need the vertex ID in the first place and suggests dropping it altogether. Voilà, cloning made easy. Any input would be welcome! |
Solving this isn't too hard from a technical perspective, but I've decided against putting any more time into this simply because its API is somewhat unclear. Take the following example: $graph = new Graph();
$v1 = $graph->createVertex();
$v2 = clone $v1;
assert(count($graph->getVertices()) === 2); // ???
I don't think the suggest behavior makes a lot of sense, so I really don't think native cloning provides a sufficiently reasonable API. the existing API methods such as |
Support native cloning of
Graph
,Vertex
andEdge
.The text was updated successfully, but these errors were encountered: