triAGENS/ArangoDB-PHP — pull request #17 by frankmayer (2012-10-15 05:12:08+00:00)
Title: Implemented basic edges support

Creating an edge, and querying for edges, inedges, outedges is implemented.

The Edge and EdgeHandler both inherit from Document and DocumentHandler respectively and can use most of the functions supplied by Document and DocumentHandler.

Edges are supported from ArangoDB 1.0 upwards.
In ArangoDB 1.1 Edges need to be inserted in special edge-collections. (collection type=3).

This is done like this:
```php
$collectionHandler = new \triagens\ArangoDb\CollectionHandler($connection);
$edgeCollection = new \triagens\ArangoDb\Collection();
$edgeCollection->setName('EdgeCollection');
$edgeCollection->set('type', 3);
$collectionHandler->create($edgeCollection);
```

A graph would be created like this:
```php
$document1 = new \triagens\ArangoDb\Document();
$document2 = new \triagens\ArangoDb\Document();
$documentHandler = new \triagens\ArangoDb\DocumentHandler($connection);
$document1->someAttribute = 'someValue1';
$document2->someAttribute = 'someValue2';

$edgeDocument = new \triagens\ArangoDb\Edge();
$edgeDocumentHandler = new \triagens\ArangoDb\EdgeHandler($connection);

$documentId1 = $documentHandler->save('ArangoDBPHPTestSuiteTestCollection01', $document1);
$documentId2 = $documentHandler->save('ArangoDBPHPTestSuiteTestCollection01', $document2);
$documentHandle1=$document1->getHandle();
$documentHandle2=$document2->getHandle();

$edgeDocument->set('label','knows');
$edgeDocumentId = $edgeDocumentHandler->saveEdge($edgeCollection->getId(), $documentHandle1, $documentHandle2, $edgeDocument);
```