mirror of https://gitee.com/bigwinds/arangodb
Graph Refactoring: Determination of ID pushed to Common
This commit is contained in:
parent
37b7630efb
commit
c7b5549b08
|
@ -253,12 +253,12 @@ Graph.prototype.drop = function () {
|
|||
/// @brief saves an edge to the graph
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.prototype._saveEdge = function(id, out_vertex, in_vertex, params) {
|
||||
Graph.prototype._saveEdge = function(id, out_vertex_id, in_vertex_id, params) {
|
||||
var results;
|
||||
|
||||
params._key = id;
|
||||
params._from = out_vertex._properties._id;
|
||||
params._to = in_vertex._properties._id;
|
||||
params._from = out_vertex_id;
|
||||
params._to = in_vertex_id;
|
||||
|
||||
results = GraphAPI.postEdge(this._properties._key, params);
|
||||
return new Edge(this, results.edge);
|
||||
|
|
|
@ -729,8 +729,8 @@ Graph.prototype.getOrAddVertex = function (id) {
|
|||
|
||||
Graph.prototype.addEdge = function (out_vertex, in_vertex, id, label, data, waitForSync) {
|
||||
return this._saveEdge(id,
|
||||
out_vertex,
|
||||
in_vertex,
|
||||
out_vertex._properties._id,
|
||||
in_vertex._properties._id,
|
||||
this._prepareEdgeData(data, label),
|
||||
waitForSync);
|
||||
};
|
||||
|
|
|
@ -563,15 +563,15 @@ Graph.prototype.drop = function (waitForSync) {
|
|||
/// @brief saves an edge to the graph
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.prototype._saveEdge = function(id, out_vertex, in_vertex, shallow, waitForSync) {
|
||||
Graph.prototype._saveEdge = function(id, out_vertex_id, in_vertex_id, shallow, waitForSync) {
|
||||
this.emptyCachedPredecessors();
|
||||
|
||||
if (id !== undefined && id !== null) {
|
||||
shallow._key = String(id);
|
||||
}
|
||||
|
||||
var ref = this._edges.save(out_vertex._properties._id,
|
||||
in_vertex._properties._id,
|
||||
var ref = this._edges.save(out_vertex_id,
|
||||
in_vertex_id,
|
||||
shallow,
|
||||
waitForSync);
|
||||
|
||||
|
|
Loading…
Reference in New Issue