Skip to content

Commit ab05311

Browse files
committed
temp
1 parent 1e35cbb commit ab05311

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Profile.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ public function __construct($url, $username, $password)
2121
$this->client = new Client();
2222
}
2323

24-
public function executeQuery($query)
24+
public function executeQuery($query ,$parameters=[])
2525
{
2626
$response = $this->client->post($this->neo4jUrl, [
2727
'auth' => [$this->username, $this->password],
2828
'json' => [
29-
'statement' => $query
29+
'statement' => $query,
30+
'parameters'=>$parameters
3031
]
3132
]);
3233

src/Query_Profile_run.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010

1111
$client = new Profile($neo4jUrl, $username, $password);
1212

13-
$query = "PROFILE MATCH (n:Person) RETURN n";
14-
$data = $client->executeQuery($query);
13+
$params = ['name' => 'Alice'];
14+
15+
$query = "PROFILE MATCH (n:Person {name: \$name}) RETURN n.name";
16+
17+
$data = $client->executeQuery($query, $params);
18+
19+
1520
$formattedResponse = $client->formatResponse($data);
1621

1722
echo json_encode($formattedResponse, JSON_PRETTY_PRINT);
18-

0 commit comments

Comments
 (0)