// do nothing
}
/* drop edge if it exists */
try {
    $edge = $collections->get("edges");
    $collections->drop($edge);
} catch (Exception $e) {
    // do nothing
}
$vertex = new Collection();
$vertex->setName("vertices");
$collections->add($vertex);
$vertex = $vertex->getId();
$edge = new Collection();
$edge->setName("edges");
$edge->setType(3);
$collections->add($edge);
$edge = $edge->getId();
print "Reading graph file...\n";
$graphfilename = $argv[1];
$actionsfilename = $argv[2];
$fp = fopen($graphfilename, "rb");
if (0x1234abcd != get_next_int64($fp)) {
    print "Endianness check failed.  Endianness swap not implemented.";
    exit;
}
$nv = get_next_int64($fp);
$ne = get_next_int64($fp);
$off = get_int64_array($fp, $nv + 1);
$ind = get_int64_array($fp, $ne);
$wgt = get_int64_array($fp, $ne);
 /**
  * Try to create and delete an edge collection
  */
 public function testCreateAndDeleteEdgeCollection()
 {
     $connection = $this->connection;
     $collection = new Collection();
     $collectionHandler = new CollectionHandler($connection);
     $name = 'ArangoDB_PHP_TestSuite_TestCollection_02';
     try {
         $collectionHandler->drop($name);
     } catch (Exception $e) {
         //Silence the exception
     }
     $collection->setName($name);
     $collection->setType(3);
     $collectionHandler->add($collection);
     $resultingCollection = $collectionHandler->get($name);
     $resultingAttribute = $resultingCollection->getName();
     $this->assertTrue($name === $resultingAttribute, 'The created collection name and resulting collection name do not match!');
     $this->assertEquals(Collection::TYPE_EDGE, $resultingCollection->getType());
     $collectionHandler->delete($collection);
 }
 /**
  * Test export as Edge object
  */
 public function testExportEdgeObjects()
 {
     if (!$this->hasExportApi) {
         return;
     }
     try {
         $this->collectionHandler->drop('ArangoDB_PHP_TestSuite_TestEdge');
     } catch (\Exception $e) {
     }
     $edgeCollection = new Collection();
     $edgeCollection->setName('ArangoDB_PHP_TestSuite_TestEdge');
     $edgeCollection->setType(Collection::TYPE_EDGE);
     $this->collectionHandler->add($edgeCollection);
     $edgeHandler = new EdgeHandler($this->connection);
     $vertexCollection = $this->collection->getName();
     for ($i = 0; $i < 100; ++$i) {
         $edgeHandler->saveEdge($edgeCollection, $vertexCollection . "/1", $vertexCollection . "/2", array("value" => $i));
     }
     $export = new Export($this->connection, $edgeCollection, array("_flat" => false));
     $cursor = $export->execute();
     $this->assertEquals(1, $cursor->getFetches());
     $this->assertNull($cursor->getId());
     $this->assertEquals(100, $cursor->getCount());
     $this->assertEquals(1, $cursor->getFetches());
     $all = $cursor->getNextBatch();
     $this->assertEquals(100, count($all));
     foreach ($all as $doc) {
         $this->assertTrue($doc instanceof Document);
         $this->assertTrue($doc instanceof Edge);
     }
     $this->assertFalse($cursor->getNextBatch());
     $this->collectionHandler->drop('ArangoDB_PHP_TestSuite_TestEdge');
 }
 // set up two document collections
 $collection = new Collection("employees");
 try {
     $collectionHandler->add($collection);
 } catch (\Exception $e) {
     // collection may already exist - ignore this error for now
 }
 $collection = new Collection("departments");
 try {
     $collectionHandler->add($collection);
 } catch (\Exception $e) {
     // collection may already exist - ignore this error for now
 }
 // set up an edge collection to link the two previous collections
 $collection = new Collection("worksFor");
 $collection->setType(3);
 try {
     $collectionHandler->add($collection);
 } catch (\Exception $e) {
     // collection may already exist - ignore this error for now
 }
 // create a new department
 $marketing = Document::createFromArray(array("name" => "Marketing"));
 $documentHandler->save("departments", $marketing);
 // create another department
 $finance = Document::createFromArray(array("name" => "Finance"));
 $documentHandler->save("departments", $finance);
 // create a new employee
 $john = Document::createFromArray(array("name" => "John"));
 $documentHandler->save("employees", $john);
 // create another employee