|
7 | 7 | [](https://codeclimate.com/github/laudis-technologies/neo4j-php-client/test_coverage)
|
8 | 8 | [](https://github.com/laudis-technologies/neo4j-php-client/blob/main/LICENSE)
|
9 | 9 |
|
10 |
| -## Effortlessly control to worlds' most powerful graph database |
| 10 | +## Control to worlds' most powerful graph database |
11 | 11 | - Pick and choose your drivers with easy configuration
|
12 | 12 | - Intuitive API
|
13 | 13 | - Extensible
|
14 | 14 | - Designed, built and tested under close supervision with the official neo4j driver team
|
15 | 15 | - Validated with [testkit](https://github.com/neo4j-drivers/testkit)*
|
16 | 16 | - Fully typed with [psalm](https://psalm.dev/)
|
17 | 17 |
|
18 |
| -*(\*) version 2.1 will integrate psalm * |
| 18 | +*(\*) version 2.1 will integrate psalm* |
19 | 19 | ## See the driver in action
|
20 | 20 |
|
21 | 21 | An example project exists on the [neo4j github](https://github.com/neo4j-examples/movies-neo4j-php-client). It uses Slim and neo4j-php-client to build an API for the classic movie's example of neo4j.
|
@@ -45,7 +45,7 @@ $client = ClientBuilder::create()
|
45 | 45 |
|
46 | 46 | You have now created a client with **bolt, HTTPS and neo4j drivers**. The default driver that the client will use is **bolt**.
|
47 | 47 |
|
48 |
| -Read more about the URLs and how to use them to configure drivers [here](). |
| 48 | +Read more about the URLs and how to use them to configure drivers [here](#in-depth-configuration). |
49 | 49 |
|
50 | 50 | ### Step 3: run a transaction
|
51 | 51 |
|
@@ -82,28 +82,28 @@ The driver manages transaction functions:
|
82 | 82 | Some examples:
|
83 | 83 |
|
84 | 84 | ```php
|
85 |
| -use Laudis\Neo4j\Contracts\UnmanagedTransactionInterface; |
| 85 | +use Laudis\Neo4j\Contracts\TransactionInterface; |
86 | 86 |
|
87 | 87 | // Do a simple merge and return the result
|
88 |
| -$result = $client->writeTransaction(static function (UnmanagedTransactionInterface $tsx) { |
| 88 | +$result = $client->writeTransaction(static function (TransactionInterface $tsx) { |
89 | 89 | $result = $tsx->run('MERGE (x {y: "z"}:X) return x');
|
90 | 90 | return $result->first()->get('x')['y'];
|
91 | 91 | });
|
92 | 92 |
|
93 | 93 | // Will result in an error
|
94 |
| -$client->readTransaction(static function (UnmanagedTransactionInterface $tsx) { |
| 94 | +$client->readTransaction(static function (TransactionInterface $tsx) { |
95 | 95 | $tsx->run('MERGE (x {y: "z"}:X) return x');
|
96 | 96 | });
|
97 | 97 |
|
98 | 98 | // This is a poorly designed transaction function
|
99 |
| -$client->writeTransaction(static function (UnmanagedTransactionInterface $tsx) use ($externalCounter) { |
| 99 | +$client->writeTransaction(static function (TransactionInterface $tsx) use ($externalCounter) { |
100 | 100 | $externalCounter->incrementNodesCreated();
|
101 | 101 | $tsx->run('MERGE (x {y: $id}:X) return x', ['id' => Uuid::v4()]);
|
102 | 102 | });
|
103 | 103 |
|
104 | 104 | // This achieves the same effect but is safe in case it should be retried. The function is now idempotent.
|
105 | 105 | $id = Uuid::v4();
|
106 |
| -$client->writeTransaction(static function (UnmanagedTransactionInterface $tsx) use ($id) { |
| 106 | +$client->writeTransaction(static function (TransactionInterface $tsx) use ($id) { |
107 | 107 | $tsx->run('MERGE (x {y: $id}:X) return x', ['id' => $id]);
|
108 | 108 | });
|
109 | 109 | $externalCounter->incrementNodesCreated();
|
|
0 commit comments