Skip to content

Commit d8b23a1

Browse files
authored
Update README.md
1 parent f771efd commit d8b23a1

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

docs/Drivers/PHP/Tutorial/README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# ArangoDB-PHP - Tutorial
2-
<a name="setting_up_connection_options"></a>
32
## Setting up the connection options
43

54
In order to use ArangoDB, you need to specify the connection options. We do so by creating a PHP array $connectionOptions. Put this code into a file named test.php in your current directory:
@@ -76,7 +75,6 @@ When updating a document that was previously/concurrently updated by another use
7675
* fail with a conflict error: if you prefer that, set OPTION_UPDATE_POLICY to conflict
7776

7877

79-
<a name="setting_up_failover"></a>
8078
## Setting up active failover
8179

8280
By default the PHP client will connect to a single endpoint only,
@@ -135,10 +133,8 @@ $connectionOptions = [
135133
```
136134

137135

138-
<a name="creating_collection"></a>
139136
## Creating a collection
140137
*This is just to show how a collection is created.*
141-
<br>
142138
*For these examples it is not needed to create a collection prior to inserting a document, as we set ArangoConnectionOptions::OPTION_CREATE to true.*
143139

144140
So, after we get the settings, we can start with creating a collection. We will create a collection named "users".
@@ -168,8 +164,6 @@ The below code will first set up the collection locally in a variable name $user
168164
var_dump($result);
169165

170166
```
171-
172-
<a name="creating_document"></a>
173167
## Creating a document
174168

175169
After we created the collection, we can start with creating an initial document. We will create a user document in a collection named "users". This collection does not need to exist yet. The first document we'll insert in this collection will create the collection on the fly. This is because we have set OPTION_CREATE to true in $connectionOptions.
@@ -206,7 +200,6 @@ Document properties can be set by using the set() method, or by directly manipul
206200

207201
As you can see, sending a document to the server is achieved by calling the save() method on the client library's *DocumentHandler* class. It needs the collection name ("users" in this case") plus the document object to be saved. save() will return the document id as created by the server. The id is a numeric value that might or might not fit in a PHP integer.
208202

209-
<a name="adding_exception_handling"></a>
210203
## Adding exception handling
211204

212205

@@ -245,7 +238,6 @@ try {
245238
}
246239
```
247240

248-
<a name="retrieving_document"></a>
249241
## Retrieving a document
250242

251243
To retrieve a document from the server, the get() method of the *DocumentHandler* class can be used. It needs the collection name plus a document id. There is also the getById() method which is an alias for get().
@@ -297,7 +289,6 @@ Whenever the document id is yet unknown, but you want to fetch a document from t
297289
This will return all documents from the specified collection (here: "users") with the properties provided in the example (here: that have an attribute "name" with a value of "John"). The result is a cursor which can be iterated sequentially or completely. We have chosen to get the complete result set above by calling the cursor's getAll() method.
298290
Note that CollectionHandler->byExample() might return multiple documents if the example is ambigious.
299291

300-
<a name="updating_document"></a>
301292
## Updating a document
302293

303294

@@ -374,7 +365,6 @@ The document that is replaced using the previous example must have been fetched
374365

375366
```
376367

377-
<a name="deleting_document"></a>
378368
## Deleting a document
379369

380370
To remove an existing document on the server, the remove() method of the *DocumentHandler* class will do. remove() just needs the document to be removed as a parameter:
@@ -400,7 +390,6 @@ Note that the document must have been fetched from the server before. If you hav
400390
```
401391

402392

403-
<a name="running_aql"></a>
404393
## Running an AQL query
405394

406395

@@ -472,7 +461,6 @@ the `_flat` attribute. This allows processing the results of arbitrary AQL queri
472461
```
473462

474463

475-
<a name="exporting_data"></a>
476464
## Exporting data
477465

478466

@@ -514,8 +502,6 @@ over all documents in a collection.
514502
}
515503
```
516504

517-
518-
<a name="bulk_documents"></a>
519505
## Bulk document handling
520506

521507

@@ -553,8 +539,6 @@ of document keys:
553539

554540

555541
```
556-
557-
<a name="dropping_collection"></a>
558542
## Dropping a collection
559543

560544

@@ -590,7 +574,6 @@ $product = $dh->get('products', 11231234);
590574

591575
See file examples/customDocumentClass.php for more details.
592576

593-
<a name="logging_exceptions"></a>
594577
## Logging exceptions
595578

596579

@@ -616,7 +599,6 @@ use ArangoDBClient\Exception as ArangoException;
616599
ArangoException::disableLogging();
617600
```
618601

619-
<a name="alltogether"></a>
620602
## Putting it all together
621603

622604
Here's the full code that combines all the pieces outlined above:
@@ -905,11 +887,8 @@ try {
905887

906888
```
907889

908-
<br>
909-
910890

911891

912-
<a name="more_info"></a>
913892
# More information
914893

915894
* More example code, containing some code to create, delete and rename collections, is provided in the **examples** subdirectory that is provided with the library.

0 commit comments

Comments
 (0)