@@ -1336,8 +1336,8 @@ public function getNeighborVertices($graph, $vertexExample, $options = array())
1336
1336
$ graph = $ graph ->getKey ();
1337
1337
}
1338
1338
1339
- $ options ['objectType ' ] = ' vertex ' ;
1340
- $ data = array_merge ( $ options , $ this -> getCursorOptions ( $ options )) ;
1339
+ $ options ['includeData ' ] = true ;
1340
+ $ options [ ' objectType ' ] = ' vertex ' ;
1341
1341
$ filterString = 'FILTER ' ;
1342
1342
$ statement = new Statement ($ this ->getConnection (), array (
1343
1343
"query " => ''
@@ -1353,38 +1353,7 @@ public function getNeighborVertices($graph, $vertexExample, $options = array())
1353
1353
}
1354
1354
$ options ['direction ' ] = $ options ['filter ' ]['direction ' ];
1355
1355
}
1356
- if (isset ($ options ['filter ' ]) && isset ($ options ['filter ' ]['properties ' ])) {
1357
- if (!isset ($ options ['filter ' ]['properties ' ][0 ])) {
1358
- $ tmp = $ options ['filter ' ]['properties ' ];
1359
- $ options ['filter ' ]['properties ' ] = array ();
1360
- $ options ['filter ' ]['properties ' ][0 ] = $ tmp ;
1361
- }
1362
- $ i = 0 ;
1363
- foreach ($ options ['filter ' ]['properties ' ] as $ filter ) {
1364
- $ i ++;
1365
- switch ($ filter ['compare ' ]) {
1366
- case "HAS " :
1367
- $ aql .= $ filterString . "HAS(a.path.edges[0], @key " . $ i . ") " ;
1368
- $ statement ->bind ('key ' . $ i , $ filter ['key ' ]);
1369
- break ;
1370
- case "HAS_NOT " :
1371
- $ aql .= $ filterString . "!HAS(a.path.edges[0], @key " . $ i . ") " ;
1372
- $ statement ->bind ('key ' . $ i , $ filter ['key ' ]);
1373
- break ;
1374
- default :
1375
- $ aql .= $ filterString . "a.path.edges[0][@key " . $ i . "] " . $ filter ['compare ' ] . " @value " . $ i ;
1376
- $ statement ->bind ('key ' . $ i , $ filter ['key ' ]);
1377
- $ statement ->bind ('value ' . $ i , $ filter ['value ' ]);
1378
- break ;
1379
- }
1380
- $ filterString = ' && ' ;
1381
- }
1382
- }
1383
1356
1384
- if (isset ($ options ['filter ' ]) && isset ($ options ['filter ' ]['labels ' ])) {
1385
- $ aql .= $ filterString . 'a.path.edges[0]["$label"] IN @labels ' ;
1386
- $ statement ->bind ('labels ' , $ options ['filter ' ]['labels ' ]);
1387
- }
1388
1357
unset($ options ['filter ' ]);
1389
1358
$ statement ->bind ('graphName ' , $ graph );
1390
1359
$ statement ->bind ('vertex ' , $ vertexExample );
@@ -1414,7 +1383,7 @@ public function getNeighborVertices($graph, $vertexExample, $options = array())
1414
1383
unset($ this ->limit );
1415
1384
}
1416
1385
1417
- $ aql .= " RETURN a.vertex " ;
1386
+ $ aql .= " RETURN a " ;
1418
1387
$ statement ->setQuery ($ aql );
1419
1388
return $ statement ->execute ();
1420
1389
@@ -1523,7 +1492,6 @@ public function getVertices($graph, $options = array())
1523
1492
}
1524
1493
1525
1494
$ options ['objectType ' ] = 'vertex ' ;
1526
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
1527
1495
$ filterString = 'FILTER ' ;
1528
1496
$ statement = new Statement ($ this ->getConnection (), array (
1529
1497
"query " => ''
@@ -1646,8 +1614,8 @@ public function getEdges($graph, $options = array())
1646
1614
$ graph = $ graph ->getKey ();
1647
1615
}
1648
1616
1649
- $ options ['objectType ' ] = 'edge ' ;
1650
- $ data = array_merge ( $ options , $ this -> getCursorOptions ( $ options )) ;
1617
+ $ options ['objectType ' ] = 'edge ' ;
1618
+ $ options [ ' includeData ' ] = true ;
1651
1619
$ filterString = 'FILTER ' ;
1652
1620
$ statement = new Statement ($ this ->getConnection (), array (
1653
1621
"query " => ''
@@ -1770,7 +1738,6 @@ public function getPaths($graph, $options = array())
1770
1738
}
1771
1739
1772
1740
$ options ['objectType ' ] = 'path ' ;
1773
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
1774
1741
$ statement = new Statement ($ this ->getConnection (), array (
1775
1742
"query " => ''
1776
1743
));
@@ -1861,21 +1828,21 @@ public function getPaths($graph, $options = array())
1861
1828
* @return Cursor
1862
1829
*/
1863
1830
public function getShortestPaths ($ graph ,
1864
- $ startVertexExample = null ,
1865
- $ endVertexExample = null ,
1831
+ $ startVertexExample = array () ,
1832
+ $ endVertexExample = array () ,
1866
1833
$ options = array ())
1867
1834
{
1868
1835
if ($ graph instanceof Graph) {
1869
1836
$ graph = $ graph ->getKey ();
1870
1837
}
1871
1838
1872
- $ options ['objectType ' ] = ' shortestPath ' ;
1873
- $ data = array_merge ( $ options , $ this -> getCursorOptions ( $ options )) ;
1839
+ $ options ['includeData ' ] = true ;
1840
+ $ options [ ' objectType ' ] = ' shortestPath ' ;
1874
1841
$ statement = new Statement ($ this ->getConnection (), array (
1875
1842
"query " => ''
1876
1843
));
1877
1844
$ statement ->setResultType ($ options ['objectType ' ]);
1878
- $ aql = "FOR a IN GRAPH_SHORTEST_PATH(@graphName, @start, @end , @options) " ;
1845
+ $ aql = "FOR a IN GRAPH_SHORTEST_PATH(@graphName, @start, @end, @options) " ;
1879
1846
1880
1847
if (isset ($ options ['direction ' ])) {
1881
1848
if ($ options ['direction ' ] === "in " ) {
@@ -1947,13 +1914,11 @@ public function getDistanceTo($graph,
1947
1914
}
1948
1915
1949
1916
$ options ['objectType ' ] = 'distanceTo ' ;
1950
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
1951
1917
$ statement = new Statement ($ this ->getConnection (), array (
1952
- "query " => '' ,
1953
- "_flat " => true
1918
+ "query " => ''
1954
1919
));
1955
1920
$ statement ->setResultType ($ options ['objectType ' ]);
1956
- $ aql = "FOR a IN GRAPH_DISTANCE_TO(@graphName, @start, @end , @options) " ;
1921
+ $ aql = "FOR a IN GRAPH_DISTANCE_TO(@graphName, @start, @end, @options) " ;
1957
1922
1958
1923
if (isset ($ options ['direction ' ])) {
1959
1924
if ($ options ['direction ' ] === "in " ) {
@@ -2062,6 +2027,8 @@ public function getCommonNeighborVertices($graph, $vertex1Example = null, $verte
2062
2027
$ statement ->bind ('graphName ' , $ graph );
2063
2028
$ statement ->bind ('vertex1 ' , $ vertex1Example );
2064
2029
$ statement ->bind ('vertex2 ' , $ vertex2Example );
2030
+ $ options1 ['includeData ' ] = true ;
2031
+ $ options2 ['includeData ' ] = true ;
2065
2032
$ statement ->bind ('options1 ' , $ options1 );
2066
2033
$ statement ->bind ('options2 ' , $ options2 );
2067
2034
if (isset ($ this ->batchsize )) {
@@ -2080,7 +2047,6 @@ public function getCommonNeighborVertices($graph, $vertex1Example = null, $verte
2080
2047
$ aql .= " RETURN a " ;
2081
2048
$ statement ->setQuery ($ aql );
2082
2049
return $ statement ->execute ();
2083
-
2084
2050
}
2085
2051
2086
2052
@@ -2198,7 +2164,6 @@ public function getAbsoluteEccentricity($graph,
2198
2164
}
2199
2165
2200
2166
$ options ['objectType ' ] = 'figure ' ;
2201
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2202
2167
$ statement = new Statement ($ this ->getConnection (), array (
2203
2168
"query " => ''
2204
2169
));
@@ -2255,7 +2220,6 @@ public function getEccentricity($graph,
2255
2220
}
2256
2221
2257
2222
$ options ['objectType ' ] = 'figure ' ;
2258
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2259
2223
$ statement = new Statement ($ this ->getConnection (), array (
2260
2224
"query " => ''
2261
2225
));
@@ -2326,7 +2290,6 @@ public function getAbsoluteCloseness($graph,
2326
2290
}
2327
2291
2328
2292
$ options ['objectType ' ] = 'figure ' ;
2329
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2330
2293
$ statement = new Statement ($ this ->getConnection (), array (
2331
2294
"query " => ''
2332
2295
));
@@ -2383,7 +2346,6 @@ public function getCloseness($graph,
2383
2346
}
2384
2347
2385
2348
$ options ['objectType ' ] = 'figure ' ;
2386
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2387
2349
$ statement = new Statement ($ this ->getConnection (), array (
2388
2350
"query " => ''
2389
2351
));
@@ -2440,7 +2402,6 @@ public function getAbsoluteBetweenness($graph,
2440
2402
}
2441
2403
2442
2404
$ options ['objectType ' ] = 'figure ' ;
2443
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2444
2405
$ statement = new Statement ($ this ->getConnection (), array (
2445
2406
"query " => ''
2446
2407
));
@@ -2494,7 +2455,6 @@ public function getBetweenness($graph, $options = array())
2494
2455
}
2495
2456
2496
2457
$ options ['objectType ' ] = 'figure ' ;
2497
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2498
2458
$ statement = new Statement ($ this ->getConnection (), array (
2499
2459
"query " => '' ,
2500
2460
"_flat " => true
@@ -2552,7 +2512,6 @@ public function getRadius($graph,
2552
2512
}
2553
2513
2554
2514
$ options ['objectType ' ] = 'figure ' ;
2555
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2556
2515
$ statement = new Statement ($ this ->getConnection (), array (
2557
2516
"query " => ''
2558
2517
));
@@ -2609,7 +2568,6 @@ public function getDiameter($graph,
2609
2568
}
2610
2569
2611
2570
$ options ['objectType ' ] = 'figure ' ;
2612
- $ data = array_merge ($ options , $ this ->getCursorOptions ($ options ));
2613
2571
$ statement = new Statement ($ this ->getConnection (), array (
2614
2572
"query " => ''
2615
2573
));
0 commit comments