Full Code of jadell/neo4jphp for AI

master 6021d88dfa70 cached
135 files
416.3 KB
131.6k tokens
1082 symbols
1 requests
Download .txt
Showing preview only (453K chars total). Download the full file or copy to clipboard to get everything.
Repository: jadell/neo4jphp
Branch: master
Commit: 6021d88dfa70
Files: 135
Total size: 416.3 KB

Directory structure:
gitextract_0kzioh7m/

├── .gitignore
├── .travis.yml
├── LICENSE
├── Neo4jPhpVersionTask.php
├── README.md
├── build.xml
├── composer.json
├── docblox.dist.xml
├── examples/
│   ├── bacon.php
│   ├── batch_benchmarks.php
│   ├── cypher.php
│   ├── directions.php
│   ├── example_bootstrap.php
│   ├── gremlin.php
│   ├── indexing.php
│   └── widgets.php
├── lib/
│   └── Everyman/
│       └── Neo4j/
│           ├── Batch/
│           │   ├── AddTo.php
│           │   ├── Delete.php
│           │   ├── Operation.php
│           │   ├── RemoveFrom.php
│           │   └── Save.php
│           ├── Batch.php
│           ├── Cache/
│           │   ├── EntityCache.php
│           │   ├── Memcache.php
│           │   ├── Memcached.php
│           │   ├── None.php
│           │   └── Variable.php
│           ├── Cache.php
│           ├── Client.php
│           ├── Command/
│           │   ├── AddLabels.php
│           │   ├── AddStatementsToTransaction.php
│           │   ├── AddToIndex.php
│           │   ├── Batch/
│           │   │   ├── AddToIndex.php
│           │   │   ├── Command.php
│           │   │   ├── Commit.php
│           │   │   ├── CreateNode.php
│           │   │   ├── CreateRelationship.php
│           │   │   ├── DeleteNode.php
│           │   │   ├── DeleteRelationship.php
│           │   │   ├── RemoveFromIndex.php
│           │   │   ├── UpdateNode.php
│           │   │   └── UpdateRelationship.php
│           │   ├── CreateNode.php
│           │   ├── CreateRelationship.php
│           │   ├── DeleteIndex.php
│           │   ├── DeleteNode.php
│           │   ├── DeleteRelationship.php
│           │   ├── ExecuteCypherQuery.php
│           │   ├── ExecuteGremlinQuery.php
│           │   ├── ExecutePagedTraversal.php
│           │   ├── ExecuteTraversal.php
│           │   ├── GetIndexes.php
│           │   ├── GetLabels.php
│           │   ├── GetNode.php
│           │   ├── GetNodeRelationships.php
│           │   ├── GetNodesForLabel.php
│           │   ├── GetPaths.php
│           │   ├── GetRelationship.php
│           │   ├── GetRelationshipTypes.php
│           │   ├── GetServerInfo.php
│           │   ├── QueryIndex.php
│           │   ├── RemoveFromIndex.php
│           │   ├── RemoveLabels.php
│           │   ├── RollbackTransaction.php
│           │   ├── SaveIndex.php
│           │   ├── SearchIndex.php
│           │   ├── SetLabels.php
│           │   ├── UpdateNode.php
│           │   └── UpdateRelationship.php
│           ├── Command.php
│           ├── Cypher/
│           │   └── Query.php
│           ├── EntityMapper.php
│           ├── Exception.php
│           ├── Geoff/
│           │   ├── Exporter.php
│           │   └── Importer.php
│           ├── Geoff.php
│           ├── Gremlin/
│           │   └── Query.php
│           ├── Index/
│           │   ├── NodeFulltextIndex.php
│           │   ├── NodeIndex.php
│           │   └── RelationshipIndex.php
│           ├── Index.php
│           ├── Label.php
│           ├── Node.php
│           ├── Pager.php
│           ├── Path.php
│           ├── PathFinder.php
│           ├── PropertyContainer.php
│           ├── Query/
│           │   ├── ResultSet.php
│           │   └── Row.php
│           ├── Query.php
│           ├── Relationship.php
│           ├── Transaction.php
│           ├── Transport/
│           │   ├── Curl.php
│           │   └── Stream.php
│           ├── Transport.php
│           ├── Traversal.php
│           └── Version.php
├── phpconfig.ini
├── stub.php
└── tests/
    ├── cs/
    │   └── ruleset.xml
    ├── phpunit.xml
    └── unit/
        └── lib/
            └── Everyman/
                └── Neo4j/
                    ├── BatchTest.php
                    ├── Cache/
                    │   ├── MemcacheTest.php
                    │   ├── MemcachedTest.php
                    │   ├── NoneTest.php
                    │   └── VariableTest.php
                    ├── ClientTest.php
                    ├── Client_Batch_IndexTest.php
                    ├── Client_Batch_NodeTest.php
                    ├── Client_Batch_RelationshipTest.php
                    ├── Client_CacheTest.php
                    ├── Client_CypherTest.php
                    ├── Client_GremlinTest.php
                    ├── Client_IndexTest.php
                    ├── Client_LabelTest.php
                    ├── Client_PathTest.php
                    ├── Client_TransactionTest.php
                    ├── Client_TraversalTest.php
                    ├── Cypher/
                    │   └── QueryTest.php
                    ├── EntityMapperTest.php
                    ├── GeoffTest.php
                    ├── Gremlin/
                    │   └── QueryTest.php
                    ├── IndexTest.php
                    ├── LabelTest.php
                    ├── NodeTest.php
                    ├── PagerTest.php
                    ├── PathFinderTest.php
                    ├── PathTest.php
                    ├── PropertyContainerTest.php
                    ├── Query/
                    │   ├── ResultSetTest.php
                    │   └── RowTest.php
                    ├── RelationshipTest.php
                    ├── TransactionTest.php
                    ├── TransportTest.php
                    └── TraversalTest.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
neo4jphp.phar
build
docs
vendor/
/.idea/
composer.lock

================================================
FILE: .travis.yml
================================================
language: php
php:
  - 5.3
  - 5.4
  - 5.5

before_script:
    - pecl install -f memcached-2.1.0
    - phpenv config-add phpconfig.ini
    - composer install --dev

script: ./vendor/bin/phing ci


================================================
FILE: LICENSE
================================================
All project code is licensed under the MIT License
http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2011 Josh Adell <josh.adell@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: Neo4jPhpVersionTask.php
================================================
<?php
require_once __DIR__.'/lib/Everyman/Neo4j/Version.php';

class Neo4jPhpVersionTask extends Task
{
	protected $property;

	public function init(){}

	public function setProperty($name)
	{
		$this->property = $name;
	}

	public function main()
	{
		$version = \Everyman\Neo4j\Version::CURRENT;
		$this->log("neo4jphp version: $version");
		$this->project->setProperty($this->property, $version);
	}
}

================================================
FILE: README.md
================================================
Neo4jPHP
========
Author: Josh Adell <josh.adell@gmail.com>  
Copyright (c) 2011-2012

PHP Wrapper for the Neo4j graph database REST interface

In-depth documentation and examples: http://github.com/jadell/neo4jphp/wiki

API documentation: http://jadell.github.com/neo4jphp

[![Build Status](https://secure.travis-ci.org/jadell/neo4jphp.png?branch=master)](http://travis-ci.org/jadell/neo4jphp)

Install
-------

### Using Composer
1. From the command line `composer require "everyman/neo4jphp" "dev-master"`
1. In your PHP script `require("vendor/autoload.php");`

Connection Test
---------------
Create a script named `neo4jphp_connect_test.php`:

```php
    <?php
    require('vendor/autoload.php');
    
    $client = new Everyman\Neo4j\Client('localhost', 7474);
    print_r($client->getServerInfo());
```

Change `localhost` or `7474` to the host name and port of your Neo4j instance.

Execute the script:

    > php neo4jphp_connect_test.php

If you see your server's information, then you have successfully connected!


Get Started
-----------
Full documentation on all the features of Neo4jPHP is available on the wiki: https://github.com/jadell/neo4jphp/wiki


Contributions
-------------
http://github.com/jadell/neo4jphp/graphs/contributors

All contributions are welcome! If you wish to contribute, please read the following guidelines:

* Before implementing new features, [open an issue](https://github.com/jadell/neo4jphp/issues) describing the feature.
* Include unit tests for any bug fixes or new features.
* Include only one bug fix or new feature per pull request.
* Make sure all unit tests run before submitting a pull request.
* Follow the coding style of the existing code: tabs for indentation, class/method braces on newlines, spaces after commas, etc.
* Contributing code means that you agree that any contributed code, documentation, or other artifacts may be released under the same license as the rest of the library.

### Quick Contributor Setup
Install the developer tools:

    > composer install --dev
    
After making your changes, run the unit tests and code style checker:

    > vendor/bin/phing ci
    
Run only unit tests:

    > vendor/bin/phing test
    
Run only style checker:

    > vendor/bin/phing cs

Pull requests will not be accepted unless all tests pass and all code meets the existing style guidelines.

### Special Thanks
* Jacob Hansson <jacob@voltvoodoo.com> - Cypher query support
* Nigel Small <nigel@nigelsmall.name> - GEOFF import/export
  * [http://py2neo.org/](http://py2neo.org/)


Changes
-------

0.1.0

* Cypher and Gremlin results handle nested arrays of nodes/relationships
* Batch request with no operations succeeds
* Delete index where index does not exist succeeds

0.0.7-beta

* Retrieve reference node in one operation
* Find and return only the first matching relationship
* Optionally use HTTPS and basic authentication
* Keep index configuration when retrieved from server
* Add Memcache caching plugin
* Do not allow use if cUrl is not detected
* PHAR is uncompressed by default

0.0.6-beta

* Create full-text indexes; easier instantiation of common index types
* Client can be initialized with a string and port instead of a Transport object
* Setting a `null` property has the same effect as removing the property
* Handle scalar values from Gremlin scripts properly
* Cypher and Gremlin queries can take an array of named parameters
* Cypher no longer uses positional parameters
* Use server info to determine Cypher plugin endpoint

0.0.5-beta

* Open a batch on the client to apply to all subsequent data manipulation calls
* Batch operations correctly set and update locally cached entities
* Method chaining on node and relationship save, load and delete
* Instantiate new nodes and relationships from the client
* Change to cache initialization; new EntityCache object

0.0.4-beta

* Client::getServerInfo() retrieves server information and connection test
* Add to index brought up to Neo4j server 1.5 specification
* Return paths from Cypher queries
* Properly encode URL entities
* Connection and transport errors throw exceptions
* Fix "unable to connect" bug from returning false positive


================================================
FILE: build.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="Neo4jPHP" default="test">
	<taskdef name="neo4jphpversion" classname="Neo4jPhpVersionTask" />

	<!-- Target: test -->
	<target name="test" description="Verify all unit tests pass; fail if not">
		<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true">
			<arg line="-c tests/phpunit.xml" />
		</exec>
	</target>

	<!-- Target: cs -->
	<target name="cs" description="Verify that coding style guidelines are met; fail if not">
		<exec executable="vendor/bin/phpcs" passthru="true" checkreturn="true">
			<arg line="--standard=./tests/cs/ruleset.xml" />
			<arg line="-s" />
			<arg line="lib" />
		</exec>
	</target>

	<!-- Target: ci -->
	<target name="ci" description="Run all targets that verify CI build is good">
		<phingcall target="test" />
		<phingcall target="cs" />
	</target>

	<!-- Target: build -->
	<target name="build" description="Copy all package release files to a build directory">
		<delete dir="./build" />
		<mkdir dir="./build" />
		<copy todir="./build">
			<fileset dir=".">
				<include name="README.md" />
				<include name="LICENSE" />
				<include name="lib/" />
			</fileset>
		</copy>
	</target>

	<!-- Target: package -->
	<target name="package" description="Package the release files into an executable PHAR" depends="build">
		<neo4jphpversion property="version" />
		<delete file="./neo4jphp.phar" />
		<pharpackage
			destfile="./neo4jphp.phar"
			basedir="./build"
			compression="none"
			stub="./stub.php"
			signature="sha1">
			<fileset dir="./build">
				<include name="**/**" />
			</fileset>
			<metadata>
				<element name="version" value="${version}" />
				<element name="authors">
					<element name="Josh Adell">
						<element name="email" value="josh.adell@gmail.com" />
					</element>
				</element>
			</metadata>
		</pharpackage>
	</target>
</project>


================================================
FILE: composer.json
================================================
{
  "name": "everyman/neo4jphp",
  "type": "library",
  "description": "Wrapper for the Neo4j graph database REST interface",
  "keywords": ["neo4j","graph","database"],
  "homepage": "http://github.com/jadell/neo4jphp/wiki",
  "license": "MIT",
  "authors": [
    {"name": "Josh Adell", "email": "josh.adell@gmail.com", "homepage": "http://joshadell.com"}
  ],
  "require": {
    "php": ">=5.3.0",
    "ext-curl": "*"
  },
  "require-dev": {
    "phing/phing": "2.6.*",
    "phpunit/phpunit": "3.7.*",
    "squizlabs/php_codesniffer": "1.5.*"
  },
  "autoload": {
    "psr-0": {"Everyman\\Neo4j":"lib/"}
  }
}


================================================
FILE: docblox.dist.xml
================================================
<?xml version="1.0" encoding="UTF-8" ?>
<docblox>
	<files>
		<directory>lib</directory>
	</files>
	<parser>
		<target>docs</target>
	</parser>
	<transformer>
		<target>docs</target>
	</transformer>
</docblox>

================================================
FILE: examples/bacon.php
================================================
#!/usr/bin/env php
<?php
use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index\NodeIndex,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node;

require_once 'example_bootstrap.php';

$cmd = !empty($argv[1]) ? $argv[1] : null;
$from = '';
$to = '';

if (!$cmd) {
	echo <<<HELP
Usage:
{$argv[0]}
	Display usage instructions

{$argv[0]} init
	Initialize the data.  This only needs to be done once.

{$argv[0]} path <from name> <to name>
	Find a path from one actor to another.


HELP;
	exit(0);
}

$client = new Client();
$actors = new NodeIndex($client, 'actors');

// Initialize the data
if ($cmd == 'init') {
	$keanu = $client->makeNode()->setProperty('name', 'Keanu Reeves')->save();
	$laurence = $client->makeNode()->setProperty('name', 'Laurence Fishburne')->save();
	$jennifer = $client->makeNode()->setProperty('name', 'Jennifer Connelly')->save();
	$kevin = $client->makeNode()->setProperty('name', 'Kevin Bacon')->save();

	$actors->add($keanu, 'name', $keanu->getProperty('name'));
	$actors->add($laurence, 'name', $laurence->getProperty('name'));
	$actors->add($jennifer, 'name', $jennifer->getProperty('name'));
	$actors->add($kevin, 'name', $kevin->getProperty('name'));

	$matrix = $client->makeNode()->setProperty('title', 'The Matrix')->save();
	$higherLearning = $client->makeNode()->setProperty('title', 'Higher Learning')->save();
	$mysticRiver = $client->makeNode()->setProperty('title', 'Mystic River')->save();

	$keanu->relateTo($matrix, 'IN')->save();
	$laurence->relateTo($matrix, 'IN')->save();

	$laurence->relateTo($higherLearning, 'IN')->save();
	$jennifer->relateTo($higherLearning, 'IN')->save();

	$laurence->relateTo($mysticRiver, 'IN')->save();
	$kevin->relateTo($mysticRiver, 'IN')->save();

// Find a path
} else if ($cmd == 'path' && !empty($argv[2]) && !empty($argv[3])) {
	$from = $argv[2];
	$to = $argv[3];

	$fromNode = $actors->findOne('name', $from);
	if (!$fromNode) {
		echo "$from not found\n";
		exit(1);
	}

	$toNode = $actors->findOne('name', $to);
	if (!$toNode) {
		echo "$to not found\n";
		exit(1);
	}

	// Each degree is an actor and movie node
	$maxDegrees = 6;
	$depth = $maxDegrees * 2;

	$path = $fromNode->findPathsTo($toNode)
		->setmaxDepth($depth)
		->getSinglePath();

	if ($path) {
		foreach ($path as $i => $node) {
			if ($i % 2 == 0) {
				$degree = $i/2;
				echo str_repeat("\t", $degree);
				echo $degree . ': ' .$node->getProperty('name');
				if ($i+1 != count($path)) {
					echo " was in ";
				}
			} else {
				echo $node->getProperty('title') . " with\n";
			}
		}
		echo "\n";
	}
}



================================================
FILE: examples/batch_benchmarks.php
================================================
#!/usr/bin/env php
<?php
namespace Everyman\Neo4j;
use Everyman\Neo4j\Client,
	Everyman\Neo4j\Batch,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node;

require_once 'example_bootstrap.php';

$client = new Client();

$runs = 5;
$series = array(
	10,
	100,
	250,
	500,
	1000,
	2500,
	5000,
);

$trials = array(
	new CreateNode($client),
	new CreateRelationship($client),
	new CreateFullRelationship($client),
);
foreach ($trials as $trial) {
	$trial->benchmark($series, $runs);
}

////////////////////////////////////////////////////////////////////////////////
// Benchmark trials ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

abstract class Benchmark
{
	protected $client = null;
	protected $title = 'unknown';

	abstract protected function batch($size);
	abstract protected function sequential($size);

	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	public function benchmark($series, $runs)
	{
		echo "Benchmark: {$this->title}\n";
		foreach ($series as $size) {
			$batchTotal = 0;
			$seqTotal = 0;
			for ($i=0; $i<$runs; $i++) {
				echo "{$size}\t{$i}\t";

				$batchTotal += $batchTime = $this->batch($size);
				echo "{$batchTime}\t";

				$seqTotal += $seqTime = $this->sequential($size);
				echo "{$seqTime}\n";
			}
			$batchAvg = round($batchTotal/$runs,2);
			$seqAvg = round($seqTotal/$runs,2);
			echo "\t\t$batchAvg\t$seqAvg\n\n";
		}
		
	}
}

class CreateNode extends Benchmark
{
	protected $title = 'Create nodes';

	protected function batch($size)
	{
		$start = time();
		$this->client->startBatch();
		foreach(range(1, $size) as $id) {
			$this->client->makeNode()->setProperty('stop_id', $id)->save();
		}
		$this->client->commitBatch();
		$end = time();
		return $end - $start;
	}

	protected function sequential($size)
	{
		$start = time();
		foreach(range(1, $size) as $id) {
			$this->client->makeNode()->setProperty('stop_id', $id)->save();
		}
		$end = time();
		return $end - $start;
	}
}

class CreateRelationship extends Benchmark
{
	protected $title = 'Create relationships';

	protected function batch($size)
	{
		$nodeA = $this->client->makeNode()->save();
		$nodeB = $this->client->makeNode()->save();

		$start = time();
		$this->client->startBatch();
		foreach(range(1, $size) as $id) {
			$nodeA->relateTo($nodeB, 'TEST')->setProperty('stop_id', $id)->save();
		}
		$this->client->commitBatch();
		$end = time();
		return $end - $start;
	}

	protected function sequential($size)
	{
		$nodeA = $this->client->makeNode()->save();
		$nodeB = $this->client->makeNode()->save();

		$start = time();
		foreach(range(1, $size) as $id) {
			$nodeA->relateTo($nodeB, 'TEST')->setProperty('stop_id', $id)->save();
		}
		$end = time();
		return $end - $start;
	}
}

class CreateFullRelationship extends Benchmark
{
	protected $title = 'Create full relationships (start node, end node, relationship)';

	protected function batch($size)
	{
		$start = time();
		$this->client->startBatch();
		foreach(range(1, $size) as $id) {
			$nodeA = $this->client->makeNode()->save();
			$nodeB = $this->client->makeNode()->save();
			$nodeA->relateTo($nodeB, 'TEST')->setProperty('stop_id', $id)->save();
		}
		$this->client->commitBatch();
		$end = time();
		return $end - $start;
	}

	protected function sequential($size)
	{
		$start = time();
		foreach(range(1, $size) as $id) {
			$nodeA = $this->client->makeNode()->save();
			$nodeB = $this->client->makeNode()->save();
			$nodeA->relateTo($nodeB, 'TEST')->setProperty('stop_id', $id)->save();
		}
		$end = time();
		return $end - $start;
	}
}


================================================
FILE: examples/cypher.php
================================================
#!/usr/bin/env php
<?php
use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index\NodeIndex,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Cypher;

require_once 'example_bootstrap.php';

$cmd = !empty($argv[1]) ? $argv[1] : null;

if (!$cmd) {
	echo <<<HELP
Usage:
{$argv[0]}
	Display usage instructions

{$argv[0]} init
	Initialize the data.  This only needs to be done once.

{$argv[0]} actors <movie_name>
	Get a list of all actors in the movie.


HELP;
	exit(0);
}

$client = new Client();
$actors = new NodeIndex($client, 'actors');

// Initialize the data
if ($cmd == 'init') {
	$keanu = $client->makeNode()->setProperty('name', 'Keanu Reeves')->save();
	$laurence = $client->makeNode()->setProperty('name', 'Laurence Fishburne')->save();
	$jennifer = $client->makeNode()->setProperty('name', 'Jennifer Connelly')->save();
	$kevin = $client->makeNode()->setProperty('name', 'Kevin Bacon')->save();

	$actors->add($keanu, 'name', $keanu->getProperty('name'));
	$actors->add($laurence, 'name', $laurence->getProperty('name'));
	$actors->add($jennifer, 'name', $jennifer->getProperty('name'));
	$actors->add($kevin, 'name', $kevin->getProperty('name'));

	$matrix = $client->makeNode()->setProperty('title', 'The Matrix')->save();
	$higherLearning = $client->makeNode()->setProperty('title', 'Higher Learning')->save();
	$mysticRiver = $client->makeNode()->setProperty('title', 'Mystic River')->save();

	$keanu->relateTo($matrix, 'IN')->save();
	$laurence->relateTo($matrix, 'IN')->save();

	$laurence->relateTo($higherLearning, 'IN')->save();
	$jennifer->relateTo($higherLearning, 'IN')->save();

	$laurence->relateTo($mysticRiver, 'IN')->save();
	$kevin->relateTo($mysticRiver, 'IN')->save();

// Find all actors in a movie
} else if ($cmd == 'actors') {
	
	if(!empty($argv[2])) {
		$movie = implode(" ", array_slice($argv,2));
	} else {
		$movie = "The Matrix";
	}
	
	$queryTemplate = "START actor=node:actors('name:*') ".
		"MATCH (actor) -[:IN]- (movie)".
		"WHERE movie.title = {title}".
		"RETURN actor";
	$query = new Cypher\Query($client, $queryTemplate, array('title'=>$movie));
	$result = $query->getResultSet();
	
	echo "Found ".count($result)." actors:\n";
	foreach($result as $row) {
		echo "  ".$row['actor']->getProperty('name')."\n";
	}
}



================================================
FILE: examples/directions.php
================================================
#!/usr/bin/env php
<?php
use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index\NodeIndex,
	Everyman\Neo4j\Path,
	Everyman\Neo4j\PathFinder,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node;

require_once 'example_bootstrap.php';

$cmd = !empty($argv[1]) ? $argv[1] : null;
$from = '';
$to = '';
$paths = array();

if (!$cmd) {
	echo <<<HELP
Usage:
{$argv[0]}
	Display usage instructions

{$argv[0]} init
	Initialize the data.  This only needs to be done once.

{$argv[0]} map
	Display the available points and the connections and distances between them.

{$argv[0]} path <start> <end> [<algorithm>]
	Find a path from one node to another.
	algorithm is optional, and can be one of:
		optimal: Find the shortest paths by distance.  Default.
		simple:  Find the shortest paths by number of nodes.
		all:     Find all paths, regardless of length.


HELP;
	exit(0);
}

$client = new Client();
$intersections = new NodeIndex($client, 'intersections1');

$inters = array(
	'A'=>null,
	'B'=>null,
	'C'=>null,
	'D'=>null,
	'E'=>null,
	'F'=>null,
);

$streets = array(
	// name, start, end, direction, travel time
	array('A', 'B', array('direction'=>'east', 'distance'=>2.1, 'name'=>'AB')),
	array('A', 'D', array('direction'=>'south', 'distance'=>2.1, 'name'=>'AD')),
	array('A', 'E', array('direction'=>'south', 'distance'=>3.1, 'name'=>'AE')),

	array('B', 'A', array('direction'=>'west', 'distance'=>2.1, 'name'=>'AB')),
	array('B', 'C', array('direction'=>'east', 'distance'=>2.1, 'name'=>'BC')),
	array('B', 'E', array('direction'=>'south', 'distance'=>2.1, 'name'=>'BE')),

	array('C', 'B', array('direction'=>'west', 'distance'=>2.1, 'name'=>'BC')),
	array('C', 'F', array('direction'=>'south', 'distance'=>1.1, 'name'=>'CF')),

	array('D', 'A', array('direction'=>'north', 'distance'=>2.1, 'name'=>'AD')),
	array('D', 'E', array('direction'=>'east', 'distance'=>2.1, 'name'=>'DE')),

	array('E', 'D', array('direction'=>'west', 'distance'=>2.1, 'name'=>'DE')),
	array('E', 'B', array('direction'=>'north', 'distance'=>2.1, 'name'=>'BE')),

	array('F', 'C', array('direction'=>'north', 'distance'=>1.1, 'name'=>'CF')),
	array('F', 'E', array('direction'=>'west', 'distance'=>2.1, 'name'=>'FE')),
);

$turns = array(
	'east' => array(
		'north' => 'left',
		'south' => 'right',
		'west' => 'u-turn',
	),
	'west' => array(
		'north' => 'right',
		'south' => 'left',
		'east' => 'u-turn',
	),
	'north' => array(
		'east' => 'right',
		'west' => 'left',
		'south' => 'u-turn',
	),
	'south' => array(
		'east' => 'left',
		'west' => 'right',
		'north' => 'u-turn',
	),
);

// Initialize the data
if ($cmd == 'init') {
	echo "Initializing data.\n";
	foreach ($inters as $inter => $temp) {
		$node = $client->makeNode()->setProperty('name', $inter)->save();
		$intersections->add($node, 'name', $node->getProperty('name'));
		$inters[$inter] = $node;
	}

	foreach ($streets as $info) {
		$start = $inters[$info[0]];
		$end = $inters[$info[1]];
		$properties = $info[2];
		$street = $start->relateTo($end, 'CONNECTS')->setProperties($properties);
		$street->save();
	}

// Find a path
} else if ($cmd == 'path' && !empty($argv[2]) && !empty($argv[3])) {
	$from = $argv[2];
	$to = $argv[3];

	$algorithm = null;
	$all = !empty($argv[4]) && $argv[4] == 'all';

	$fromNode = $intersections->findOne('name', $from);
	$toNode = $intersections->findOne('name', $to);

	$finder = $fromNode->findPathsTo($toNode, 'CONNECTS', Relationship::DirectionOut)
		->setMaxDepth(5);

	$algorithm = !empty($argv[4]) ? $argv[4] : null;

	// Find all paths regardless of complexity or distance
	if ($algorithm == 'all') {
		$finder->setAlgorithm(PathFinder::AlgoAllSimple);

	// Find paths with the smallest number of instructions
	} else if ($algorithm == 'simple') {
		$finder->setAlgorithm(PathFinder::AlgoShortest);

	// Find the most optimal paths
	} else {
		$finder->setAlgorithm(PathFinder::AlgoDijkstra)
			->setCostProperty('distance');
	}

	$paths = $finder->getPaths();
}

echo <<<MAP
Map:
	A <-2-> B <-2-> C
	^\      ^       ^
	| \     |       |
	|  \    |       |
	|   \   |       |
	2   3\  2       1
	|     \ |       |
	|      \|       |
	V       V       V
	D <-2-> E <-2-- F 
MAP;
echo "\n\n";

foreach ($paths as $i => $path) {
	$path->setContext(Path::ContextRelationship);
	$prevDirection = null;
	$totalDistance = 0;

	echo "Path " . ($i+1) .":\n";
	foreach ($path as $j => $rel) {
		$direction = $rel->getProperty('direction');
		$distance = $rel->getProperty('distance');
		$name = $rel->getProperty('name');

		if (!$prevDirection) {
			$action = 'Head';
		} else if ($prevDirection == $direction) {
			$action = 'Continue';
		} else {
			$turn = $turns[$prevDirection][$direction];
			$action = "Turn $turn, and continue";
		}
		$prevDirection = $direction;
		$step = $j+1;
		$totalDistance += $distance;

		echo "\t{$step}: {$action} {$direction} on {$name} for {$distance} miles.\n";
	}
	echo "\tTravel distance: {$totalDistance}\n\n";
}





================================================
FILE: examples/example_bootstrap.php
================================================
<?php
error_reporting(-1);
ini_set('display_errors', 1);
spl_autoload_register(function ($sClass) {
	$sLibPath = __DIR__.'/../lib/';
	$sClassFile = str_replace('\\',DIRECTORY_SEPARATOR,$sClass).'.php';
	$sClassPath = $sLibPath.$sClassFile;
	if (file_exists($sClassPath)) {
		require($sClassPath);
	}
});


================================================
FILE: examples/gremlin.php
================================================
#!/usr/bin/env php
<?php
use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index\NodeIndex,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Gremlin;

require_once 'example_bootstrap.php';

$cmd = !empty($argv[1]) ? $argv[1] : null;

if (!$cmd) {
	echo <<<HELP
Usage:
{$argv[0]}
	Display usage instructions

{$argv[0]} init
	Initialize the data.  This only needs to be done once.

{$argv[0]} actors
	Get a list of all actors in the database.

HELP;
	exit(0);
}

$client = new Client();
$actors = new NodeIndex($client, 'actors');

// Initialize the data
if ($cmd == 'init') {
	$keanu = $client->makeNode()->setProperty('name', 'Keanu Reeves')->save();
	$laurence = $client->makeNode()->setProperty('name', 'Laurence Fishburne')->save();
	$jennifer = $client->makeNode()->setProperty('name', 'Jennifer Connelly')->save();
	$kevin = $client->makeNode()->setProperty('name', 'Kevin Bacon')->save();

	$actors->add($keanu, 'name', $keanu->getProperty('name'));
	$actors->add($laurence, 'name', $laurence->getProperty('name'));
	$actors->add($jennifer, 'name', $jennifer->getProperty('name'));
	$actors->add($kevin, 'name', $kevin->getProperty('name'));

	$matrix = $client->makeNode()->setProperty('title', 'The Matrix')->save();
	$higherLearning = $client->makeNode()->setProperty('title', 'Higher Learning')->save();
	$mysticRiver = $client->makeNode()->setProperty('title', 'Mystic River')->save();

	$keanu->relateTo($matrix, 'IN')->save();
	$laurence->relateTo($matrix, 'IN')->save();

	$laurence->relateTo($higherLearning, 'IN')->save();
	$jennifer->relateTo($higherLearning, 'IN')->save();

	$laurence->relateTo($mysticRiver, 'IN')->save();
	$kevin->relateTo($mysticRiver, 'IN')->save();

// Find all actors in a movie
} else if ($cmd == 'actors') {
	$queryTemplate = "g.V.in(type).dedup.sort{it.name}.toList()";
	$params = array('type' => 'IN');
	$query = new Gremlin\Query($client, $queryTemplate, $params);
	$result = $query->getResultSet();
	
	foreach ($result as $row) {
		echo "* " . $row[0]->getProperty('name')."\n";
	}
}



================================================
FILE: examples/indexing.php
================================================
#!/usr/bin/env php
<?php
use Everyman\Neo4j\Client,
    Everyman\Neo4j\Index\NodeIndex,
    Everyman\Neo4j\Index\RelationshipIndex,
    Everyman\Neo4j\Index\NodeFulltextIndex,
    Everyman\Neo4j\Node,
    Everyman\Neo4j\Batch;

require_once 'example_bootstrap.php';

$client = new Client();

$actorIndex = new NodeIndex($client, 'actors');
$roleIndex = new RelationshipIndex($client, 'roles');
$plotIndex = new NodeFulltextIndex($client, 'plots');
$plotIndex->save();

$leslie = $client->makeNode()
	->setProperty('name', 'Leslie Nielsen')
	->save();

$airplane = $client->makeNode()
	->setProperty('title', 'Airplane')
	->save();

$rumack = $leslie->relateTo($airplane, 'PLAYED')
	->setProperty('character', 'Dr. Rumack')
	->save();

$actorIndex->add($leslie, 'name', $leslie->getProperty('name'));
$roleIndex->add($rumack, 'character', $rumack->getProperty('character'));
$plotIndex->add($airplane, 'synopsis', 'An airplane crew takes ill. Surely the only person capable of landing the plane is an ex-pilot afraid to fly. But don\'t call him Shirley.');

echo $actorIndex->queryOne('name:Leslie*')->getProperty('name') . "\n";
echo $roleIndex->queryOne('character:*u*')->getProperty('character') . "\n";
echo $plotIndex->queryOne('synopsis:lend~0.2')->getProperty('title') . "\n";




================================================
FILE: examples/widgets.php
================================================
#!/usr/bin/env php
<?php
use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index\NodeIndex,
	Everyman\Neo4j\Path,
	Everyman\Neo4j\PathFinder,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Cypher,
	Everyman\Neo4j\Traversal;

require_once 'example_bootstrap.php';

$cmd = !empty($argv[1]) ? $argv[1] : null;
$from = '';
$to = '';
$paths = array();

if (!$cmd) {
	echo <<<HELP
Usage:
{$argv[0]}
	Display usage instructions

{$argv[0]} init
	Initialize the data.  This only needs to be done once.

{$argv[0]} parts
	Display the available parts in the system.

{$argv[0]} stores <part> [<language>]
	Find all the stores where the given part was sold.
	Language can be one of:
		traverse: use the javascript traversal. Default.
		cypher: use a cypher query


HELP;
	exit(0);
}

$client = new Client();
$partsIndex = new NodeIndex($client, 'parts3');

$parts = array('widget','gadget','gizmo');
$stores = array("Bob's Old Houseware","Mainstreet Hardware","Nutz N' Boltz", "Doodad Emporium");
// Store, part list
$orders = array(
	array(0, array(0,1)),
	array(0, array(1)),
	array(1, array(1,2)),
	array(1, array(0,2)),
	array(2, array(0,1,2)),
	array(3, array(2)),
	array(3, array(0)),
);

// Initialize the data
if ($cmd == 'init') {
	echo "Initializing data.\n";
	$p = array();
	$s = array();

	foreach ($parts as $part) {
		$node = $client->makeNode()->setProperty('name', $part)->save();
		$partsIndex->add($node, 'name', $node->getProperty('name'));
		$p[] = $node;
	}

	foreach ($stores as $store) {
		$node = $client->makeNode()->setProperty('name', $store)->save();
		$s[] = $node;
	}

	foreach ($orders as $order) {
		$node = $client->makeNode()->save();

		$s[$order[0]]->relateTo($node, 'SOLD')->save();
		foreach ($order[1] as $pi) {
			$node->relateTo($p[$pi], 'CONTAINS')->save();
		}
	}

// List parts
} else if ($cmd == 'parts') {
	$partsList = $partsIndex->query('name:*');
	foreach ($partsList as $part) {
		echo "* {$part->getProperty('name')}\n";
	}

// Find stores where the part was sold
} else if ($cmd == 'stores' && !empty($argv[2])) {
	$partName = $argv[2];

	// Use the Cypher query language
	if (!empty($argv[3]) && $argv[3] == 'cypher') {
		$queryTemplate = "START part=node:parts3('name:{$partName}') ".
			"MATCH (store)-[:SOLD]->()-[:CONTAINS]->(part) ".
			// Use the count(*) to force distinct values until Cypher gets DISTINCT keyword support
			"RETURN store, count(*)";
		$query = new Cypher\Query($client, $queryTemplate);
		$result = $query->getResultSet();
	
		echo "Found ".count($result)." stores:\n";
		foreach($result as $row) {
			echo "* ".$row['store']->getProperty('name')."\n";
		}
	
	// Use javascript traversal
	} else {
		$part = $partsIndex->findOne('name', $partName);
		if (!$part) {
			die("{$partName} not found.\n");
		}

		$traversal = new Traversal($client);
		$traversal->addRelationship('CONTAINS', Relationship::DirectionIn)
			->addRelationship('SOLD', Relationship::DirectionIn)
			->setMaxDepth(4)
			->setReturnFilter('javascript', '(position.length() > 0 && position.lastRelationship().getType() == "SOLD");');

		$stores = $traversal->getResults($part, Traversal::ReturnTypeNode);
		echo "Found ".count($stores)." stores:\n";
		foreach ($stores as $store) {
			echo "* {$store->getProperty('name')}\n";
		}
	}
}





================================================
FILE: lib/Everyman/Neo4j/Batch/AddTo.php
================================================
<?php
namespace Everyman\Neo4j\Batch;

use Everyman\Neo4j\Batch,
	Everyman\Neo4j\Command\Batch as Command,
	Everyman\Neo4j\Index,
	Everyman\Neo4j\PropertyContainer;

/**
 * An add-to-index operation
 */
class AddTo extends Operation
{
	protected $command = null;
	protected $index = null;
	protected $key = null;
	protected $value = null;

	/**
	 * Build the operation
	 *
	 * @param Batch $batch
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @param integer $opId
	 */
	public function __construct(Batch $batch, Index $index, PropertyContainer $entity, $key, $value, $opId)
	{
		parent::__construct($batch, 'addto', $entity, $opId);
		$this->index = $index;
		$this->key = $key;
		$this->value = $value;
	}

	/**
	 * Get the command that represents this operation
	 *
	 * @return Batch\Command
	 */
	public function getCommand()
	{
		if (!$this->command) {
			$this->command = new Command\AddToIndex(
				$this->batch->getClient(),
				$this->index,
				$this->entity,
				$this->key,
				$this->value,
				$this->opId,
				$this->batch
			);
		}
		return $this->command;
	}

	/**
	 * Get the index
	 *
	 * @return Index
	 */
	public function getIndex()
	{
		return $this->index;
	}

	/**
	 * Get the key being indexed
	 *
	 * @return string
	 */
	public function getKey()
	{
		return $this->key;
	}

	/**
	 * Get the value being indexed
	 *
	 * @return mixed
	 */
	public function getValue()
	{
		return $this->value;
	}

	/**
	 * Based on this operations parameters, generate a consistent id
	 *
	 * @return mixed
	 */
	public function matchId()
	{
		return parent::matchId() . spl_object_hash($this->index) . $this->key . $this->value;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Batch/Delete.php
================================================
<?php
namespace Everyman\Neo4j\Batch;

use Everyman\Neo4j\Batch,
	Everyman\Neo4j\Command\Batch as Command,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\PropertyContainer;

/**
 * A delete operation
 */
class Delete extends Operation
{
	protected $command = null;

	/**
	 * Build the operation
	 *
	 * @param Batch $batch
	 * @param PropertyContainer $entity
	 * @param integer $opId
	 */
	public function __construct(Batch $batch, PropertyContainer $entity, $opId)
	{
		parent::__construct($batch, 'delete', $entity, $opId);
	}

	/**
	 * Get the command that represents this operation
	 *
	 * @return Batch\Command
	 */
	public function getCommand()
	{
		if (!$this->command) {
			$entity = $this->entity;
			$command = null;
			if ($entity instanceof Node) {
				$command = new Command\DeleteNode($this->batch->getClient(), $entity, $this->opId);
			} else if ($entity instanceof Relationship) {
				$command = new Command\DeleteRelationship($this->batch->getClient(), $entity, $this->opId);
			}

			$this->command = $command;
		}
		return $this->command;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Batch/Operation.php
================================================
<?php
namespace Everyman\Neo4j\Batch;

use Everyman\Neo4j\Batch,
	Everyman\Neo4j\PropertyContainer;

/**
 * A single operation in a batch
 */
abstract class Operation
{
	protected $batch = null;
	protected $operation = null;
	protected $entity = null;
	protected $opId = null;

	protected $reserved = false;

	/**
	 * Build the operation
	 *
	 * @param Batch $batch
	 * @param string $operation
	 * @param PropertyContainer $entity
	 * @param integer $opId
	 */
	public function __construct(Batch $batch, $operation, PropertyContainer $entity, $opId)
	{
		$this->batch = $batch;
		$this->operation = $operation;
		$this->entity = $entity;
		$this->opId = $opId;
	}

	/**
	 * Get the underlying batch command for this operation
	 *
	 * @return Batch\Command
	 */
	abstract public function getCommand();

	/**
	 * Return the associated entity
	 *
	 * @return PropertyContainer
	 */
	public function getEntity()
	{
		return $this->entity;
	}

	/**
	 * Get the operation id
	 *
	 * @return integer
	 */
	public function getId()
	{
		return $this->opId;
	}

	/**
	 * Based on this operations parameters, generate a consistent id
	 *
	 * @return mixed
	 */
	public function matchId()
	{
		return $this->operation . spl_object_hash($this->entity);
	}

	/**
	 * Reserve this operation to prevent it from being double-committed
	 * Once an operation has been reserved, future reserve calls will
	 * return false, indicating it has already been reserved.
	 * This is mostly useful during commit to prevent an operation being
	 * sent twice
	 *
	 * @return boolean true if reservation succeeded
	 */
	public function reserve()
	{
		if (!$this->reserved) {
			$this->reserved = true;
			return true;
		}
		return false;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Batch/RemoveFrom.php
================================================
<?php
namespace Everyman\Neo4j\Batch;

use Everyman\Neo4j\Batch,
	Everyman\Neo4j\Command\Batch as Command,
	Everyman\Neo4j\Index,
	Everyman\Neo4j\PropertyContainer;

/**
 * A remove-from-index operation
 */
class RemoveFrom extends Operation
{
	protected $command = null;
	protected $index = null;
	protected $key = null;
	protected $value = null;

	/**
	 * Build the operation
	 *
	 * @param Batch $batch
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @param integer $opId
	 */
	public function __construct(Batch $batch, Index $index, PropertyContainer $entity, $key, $value, $opId)
	{
		parent::__construct($batch, 'removefrom', $entity, $opId);
		$this->index = $index;
		$this->key = $key;
		$this->value = $value;
	}

	/**
	 * Get the command that represents this operation
	 *
	 * @return Batch\Command
	 */
	public function getCommand()
	{
		if (!$this->command) {
			$this->command = new Command\RemoveFromIndex(
				$this->batch->getClient(),
				$this->index,
				$this->entity,
				$this->key,
				$this->value,
				$this->opId
			);
		}
		return $this->command;
	}

	/**
	 * Based on this operations parameters, generate a consistent id
	 *
	 * @return mixed
	 */
	public function matchId()
	{
		return parent::matchId() . spl_object_hash($this->index) . $this->key . $this->value;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Batch/Save.php
================================================
<?php
namespace Everyman\Neo4j\Batch;

use Everyman\Neo4j\Batch,
	Everyman\Neo4j\Command\Batch as Command,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\PropertyContainer;

/**
 * A save operation
 */
class Save extends Operation
{
	protected $command = null;

	/**
	 * Build the operation
	 *
	 * @param Batch $batch
	 * @param PropertyContainer $entity
	 * @param integer $opId
	 */
	public function __construct(Batch $batch, PropertyContainer $entity, $opId)
	{
		parent::__construct($batch, 'save', $entity, $opId);
	}

	/**
	 * Get the command that represents this operation
	 *
	 * @return Batch\Command
	 */
	public function getCommand()
	{
		if (!$this->command) {
			$entity = $this->entity;
			$command = null;
			if (!$entity->hasId()) {
				if ($entity instanceof Node) {
					$command = new Command\CreateNode($this->batch->getClient(), $entity, $this->opId);
				} else if ($entity instanceof Relationship) {
					$command = new Command\CreateRelationship($this->batch->getClient(), $entity, $this->opId, $this->batch);
				}
			} else {
				if ($entity instanceof Node) {
					$command = new Command\UpdateNode($this->batch->getClient(), $entity, $this->opId);
				} else if ($entity instanceof Relationship) {
					$command = new Command\UpdateRelationship($this->batch->getClient(), $entity, $this->opId);
				}
			}

			$this->command = $command;
		}
		return $this->command;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Batch.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * A set of operations expected to succeed (or fail) atomically
 */
class Batch
{
	protected $client = null;

	protected $committed = false;
	protected $operations = array();
	protected $matches = array();

	/**
	 * Build the batch and set its client
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	/**
	 * Add the given entity to the given index with the given key/value
	 *
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return integer
	 */
	public function addToIndex(Index $index, PropertyContainer $entity, $key, $value)
	{
		return $this->addOperation(new Batch\AddTo($this, $index, $entity, $key, $value, $this->nextId()));
	}

	/**
	 * Commit the batch to the server
	 *
	 * @return boolean
	 */
	public function commit()
	{
		if ($this->committed) {
			throw new Exception('Cannot commit the same batch more than once.');
		}
		$this->committed = true;

		return $this->client->commitBatch($this);
	}

	/**
	 * Add an entity to the batch to delete
	 *
	 * @param PropertyContainer $entity
	 * @return integer
	 */
	public function delete(PropertyContainer $entity)
	{
		return $this->addOperation(new Batch\Delete($this, $entity, $this->nextId()));
	}

	/**
	 * Get the batch's client
	 *
	 * @return Client
	 */
	public function getClient()
	{
		return $this->client;
	}

	/**
	 * Return the list of operations in this batch
	 *
	 * @return array
	 */
	public function getOperations()
	{
		return $this->operations;
	}

	/**
	 * Remove the given entity from the given index with the given key/value
	 *
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return integer
	 */
	public function removeFromIndex(Index $index, PropertyContainer $entity, $key=null, $value=null)
	{
		return $this->addOperation(new Batch\RemoveFrom($this, $index, $entity, $key, $value, $this->nextId()));
	}

	/**
	 * Reserve an operation to prevent it from being double-committed
	 * Once an operation has been reserved, future reserve calls will
	 * return false, indicating it has already been reserved.
	 * This is mostly useful during commit to prevent an operation being
	 * sent twice
	 *
	 * @param integer $opId
	 * @return mixed array operation if not yet reserved, false otherwise
	 */
	public function reserve($opId)
	{
		if (isset($this->operations[$opId]) && $this->operations[$opId]->reserve()) {
			return $this->operations[$opId];
		}
		return false;
	}

	/**
	 * Add an entity to the batch to save
	 *
	 * @param PropertyContainer $entity
	 * @return integer
	 */
	public function save(PropertyContainer $entity)
	{
		return $this->addOperation(new Batch\Save($this, $entity, $this->nextId()));
	}

	/**
	 * Add an operation to the batch
	 *
	 * @param Batch\Operation $operation
	 * @return integer operation index
	 */
	protected function addOperation(Batch\Operation $operation)
	{
		$opId = $operation->getId();
		$matchId = $operation->matchId();

		if (isset($this->matches[$matchId])) {
			return $this->matches[$matchId]->getId();
		}

		$this->operations[$opId] = $operation;
		$this->matches[$matchId] = $operation;
		return $opId;
	}

	/**
	 * Get the next unused id
	 *
	 * @return integer
	 */
	protected function nextId()
	{
		return count($this->operations);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cache/EntityCache.php
================================================
<?php
namespace Everyman\Neo4j\Cache;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\PropertyContainer,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Cache;

/**
 * Store and retrieve cached entities without hitting the server
 */
class EntityCache
{
	protected $client = null;
	protected $cache = null;
	protected $cacheTimeout = null;

	/**
	 * Set the client and caching plugin to use
	 *
	 * @param Client $client
	 * @param Cache $cache
	 * @param integer $cacheTimeout
	 */
	public function __construct(Client $client, Cache $cache=null, $cacheTimeout=null)
	{
		$this->client = $client;
		$this->setCache($cache, $cacheTimeout);
	}

	/**
	 * Delete an entity from the cache
	 *
	 * @param PropertyContainer $entity
	 */
	public function deleteCachedEntity(PropertyContainer $entity)
	{
		$this->getCache()->delete($this->getEntityCacheKey($entity));
	}

	/**
	 * Get an entity from the cache
	 *
	 * @param integer $id
	 * @param string $type
	 */
	public function getCachedEntity($id, $type)
	{
		if ($type != 'node' && $type != 'relationship') {
			throw new Exception('Unknown entity type: '.$type);
		}

		$entity = $this->getCache()->get("{$type}-{$id}");
		if ($entity) {
			$entity->setClient($this->client);
		}
		return $entity;
	}

	/**
	 * Set the cache to use
	 *
	 * @param Cache $cache
	 * @param integer $cacheTimeout
	 */
	public function setCache(Cache $cache=null, $cacheTimeout=null)
	{
		$this->cache = $cache;
		$this->cacheTimeout = (int)$cacheTimeout;
	}

	/**
	 * Set an entity in the cache
	 *
	 * @param PropertyContainer $entity
	 */
	public function setCachedEntity(PropertyContainer $entity)
	{
		$this->getCache()->set($this->getEntityCacheKey($entity), $entity, $this->cacheTimeout);
	}

	/**
	 * Get the cache plugin
	 *
	 * @return Cache
	 */
	protected function getCache()
	{
		if ($this->cache === null) {
			$this->setCache(new Cache\None(), $this->cacheTimeout);
		}
		return $this->cache;
	}

	/**
	 * Determine the cache key used to retrieve the given entity from the cache
	 *
	 * @param PropertyContainer $entity
	 * @return string
	 */
	protected function getEntityCacheKey(PropertyContainer $entity)
	{
		if ($entity instanceof Node) {
			return 'node-'.$entity->getId();
		} else if ($entity instanceof Relationship) {
			return 'relationship-'.$entity->getId();
		}
		throw new Exception('Unknown entity type: '.get_class($entity));
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cache/Memcache.php
================================================
<?php
namespace Everyman\Neo4j\Cache;

use Everyman\Neo4j\Cache;

/**
 * Use the Memcache extension
 */
class Memcache implements Cache
{
	protected $memcache = null;

	/**
	 * Initialize the Memcache connection
	 *
	 * @param Memcache $memcache
	 */
	public function __construct(\Memcache $memcache)
	{
		$this->memcache = $memcache;
	}

	/**
	 * Delete a value from the cache
	 *
	 * @param string $key
	 * @return boolean true on success
	 */
	public function delete($key)
	{
		return $this->memcache->delete($key);
	}

	/**
	 * Retrieve a value
	 * Returns false if the key does not
	 * exist, or the value is false
	 *
	 * @param string $key
	 * @return mixed
	 */
	public function get($key)
	{
		return $this->memcache->get($key);
	}

	/**
	 * Store a value in the cache
	 * $expire is specified as an integer:
	 *   - less than or equal to 2592000 (the number of seconds in 30 days)
	 *     will be considered an expire time of that many seconds from the
	 *     current timestamp
	 *   - Greater than that amount will be considered as literal Unix
	 *     timestamp values
	 *   - 0 means "never expire."
	 *
	 * @param string $key
	 * @param mixed $value
	 * @param integer $expire
	 * @return boolean true on success
	 */
	public function set($key, $value, $expire=0)
	{
		return $this->memcache->set($key, $value, 0, $expire);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cache/Memcached.php
================================================
<?php
namespace Everyman\Neo4j\Cache;

use Everyman\Neo4j\Cache;

/**
 * Use the Memcached extension
 */
class Memcached implements Cache
{
	protected $memcached = null;

	/**
	 * Initialize the Memcached connection
	 *
	 * @param Memcached $memcached
	 */
	public function __construct(\Memcached $memcached)
	{
		$this->memcached = $memcached;
	}

	/**
	 * Delete a value from the cache
	 *
	 * @param string $key
	 * @return boolean true on success
	 */
	public function delete($key)
	{
		return $this->memcached->delete($key);
	}

	/**
	 * Retrieve a value
	 * Returns false if the key does not
	 * exist, or the value is false
	 *
	 * @param string $key
	 * @return mixed
	 */
	public function get($key)
	{
		return $this->memcached->get($key);
	}

	/**
	 * Store a value in the cache
	 * $expire is specified as an integer:
	 *   - less than or equal to 2592000 (the number of seconds in 30 days)
	 *     will be considered an expire time of that many seconds from the
	 *     current timestamp
	 *   - Greater than that amount will be considered as literal Unix
	 *     timestamp values
	 *   - 0 means "never expire."
	 *
	 * @param string $key
	 * @param mixed $value
	 * @param integer $expire
	 * @return boolean true on success
	 */
	public function set($key, $value, $expire=0)
	{
		return $this->memcached->set($key, $value, $expire);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cache/None.php
================================================
<?php
namespace Everyman\Neo4j\Cache;

use Everyman\Neo4j\Cache;

/**
 * Cache that always indicates success but does not store anything
 */
class None implements Cache
{
	/**
	 * Delete always succeeds
	 *
	 * @param string $key
	 * @return boolean true on success
	 */
	public function delete($key)
	{
		return true;
	}

	/**
	 * Always false, since no value is stored
	 *
	 * @param string $key
	 * @return mixed
	 */
	public function get($key)
	{
		return false;
	}

	/**
	 * Always indicates success, but does not actually store value
	 *
	 * @param string $key
	 * @param mixed $value
	 * @param integer $expire
	 * @return boolean true on success
	 */
	public function set($key, $value, $expire=0)
	{
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cache/Variable.php
================================================
<?php
namespace Everyman\Neo4j\Cache;

use Everyman\Neo4j\Cache;

/**
 * Cache everything locally to the process
 * Values cached this way are not persisted
 * when the process or request ends.
 */
class Variable implements Cache
{
	protected $items = array();

	/**
	 * Delete a value from the cache
	 *
	 * @param string $key
	 * @return boolean true on success
	 */
	public function delete($key)
	{
		unset($this->items[$key]);
		return true;
	}

	/**
	 * Retrieve a value
	 * Returns false if the key does not
	 * exist, or the value is false
	 *
	 * @param string $key
	 * @return mixed
	 */
	public function get($key)
	{
		$value = false;
		if (isset($this->items[$key])) {
			if ($this->items[$key]['expire'] >= time()) {
				$value = $this->items[$key]['value'];
			} else {
				$this->delete($key);
			}
		}

		return $value;
	}

	/**
	 * Store a value in the cache
	 * $expire is specified as an integer:
	 *   - less than or equal to 2592000 (the number of seconds in 30 days)
	 *     will be considered an expire time of that many seconds from the
	 *     current timestamp
	 *   - Greater than that amount will be considered as literal Unix
	 *     timestamp values
	 *   - 0 means "never expire."
	 *
	 * @param string $key
	 * @param mixed $value
	 * @param integer $expire
	 * @return boolean true on success
	 */
	public function set($key, $value, $expire=0)
	{
		$expire = $this->calculateExpiration($expire);

		$this->items[$key] = array(
			'value' => $value,
			'expire' => $expire,
		);
		return true;
	}

	/**
	 * Determine the expiration timestamp
	 *
	 * @param integer $expire
	 * @return integer
	 */
	protected function calculateExpiration($expire)
	{
		if (!$expire) {
			$expire = PHP_INT_MAX;
		} else if ($expire <= 2592000) {
			$expire = time() + $expire;
		}
		return $expire;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cache.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Interface for interacting with a caching backend
 */
interface Cache
{
	/**
	 * Delete a value from the cache
	 *
	 * @param string $key
	 * @return boolean true on success
	 */
	public function delete($key);

	/**
	 * Retrieve a value
	 * Returns false if the key does not
	 * exist, or the value is false
	 *
	 * @param string $key
	 * @return mixed
	 */
	public function get($key);

	/**
	 * Store a value in the cache
	 * $expire is specified as an integer:
	 *   - less than or equal to 2592000 (the number of seconds in 30 days)
	 *     will be considered an expire time of that many seconds from the
	 *     current timestamp
	 *   - Greater than that amount will be considered as literal Unix
	 *     timestamp values
	 *   - 0 means "never expire."
	 *
	 * @param string $key
	 * @param mixed $value
	 * @param integer $expire
	 * @return boolean true on success
	 */
	public function set($key, $value, $expire=0);
}


================================================
FILE: lib/Everyman/Neo4j/Client.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Point of interaction between client and neo4j server
 */
class Client
{
	const ErrorUnknown       = 500;
	const ErrorBadRequest    = 400;
	const ErrorNotFound      = 404;
	const ErrorConflict      = 409;

	const RefNodeId = 0;

	const CapabilityCypher        = 'cypher';
	const CapabilityGremlin       = 'gremlin';
	const CapabilityLabel         = 'label';
	const CapabilityTransactions  = 'transactions';

	protected $transport = null;
	protected $entityMapper = null;
	protected $entityCache = null;
	protected $labelCache = null;
	protected $serverInfo = null;
	protected $openBatch = null;

	/**
	 * @var callable The node factory
	 */
	protected $nodeFactory = null;
	/**
	 * @var callable The relation factory
	 */
	protected $relFactory = null;

	/**
	 * Initialize the client
	 *
	 * @param mixed $transport Transport object or string hostname
	 * @param integer $port Ignored unless $transport is a hostname
	 */
	public function __construct($transport=null, $port=7474)
	{
		try {
			if ($transport === null) {
				$transport = new Transport\Curl();
			} else if (is_string($transport)) {
				$transport = new Transport\Curl($transport, $port);
			}
		} catch (Exception $e) {
			if ($transport === null) {
				$transport = new Transport\Stream();
			} else if (is_string($transport)) {
				$transport = new Transport\Stream($transport, $port);
			}
		}

		$this->setTransport($transport);
		$this->setNodeFactory(function (Client $client, $properties=array()) {
			return new Node($client);
		});
		$this->setRelationshipFactory(function (Client $client, $properties=array()) {
			return new Relationship($client);
		});

		$this->labelCache = new Cache\Variable();
	}

	/**
	 * Add a set of labels to a node
	 *
	 * @param Node  $node
	 * @param Label[] $labels list of Label objects to add
	 * @return Label[] of Label objects; the entire list of labels on the given node
	 *   including the ones just added
	 */
	public function addLabels(Node $node, $labels)
	{
		$command = new Command\AddLabels($this, $node, $labels);
		return $this->runCommand($command);
	}

	/**
	 * Add statements to a transaction, and optionally commit the transaction
	 *
	 * @param Transaction $transaction
	 * @param array $statements an array of Cypher\Query objects
	 * @param boolean $commit should this transaction be committed on this request?
	 * @return Query\ResultSet
	 */
	public function addStatementsToTransaction(Transaction $transaction, $statements=array(), $commit=false)
	{
		$command = new Command\AddStatementsToTransaction($this, $transaction, $statements, $commit);
		return $this->runCommand($command);
	}

	/**
	 * Add an entity to an index
	 *
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return boolean
	 */
	public function addToIndex(Index $index, PropertyContainer $entity, $key, $value)
	{
		if ($this->openBatch) {
			$this->openBatch->addToIndex($index, $entity, $key, $value);
			return true;
		}

		return $this->runCommand(new Command\AddToIndex($this, $index, $entity, $key, $value));
	}

	/**
	 * Begin a Cypher transaction
	 *
	 * @return Transaction
	 */
	public function beginTransaction()
	{
		return new Transaction($this);
	}

	/**
	 * Commit a batch of operations
	 *
	 * @param Batch $batch
	 * @throws Exception
	 * @return boolean true on success
	 */
	public function commitBatch(Batch $batch=null)
	{
		if (!$batch) {
			if (!$this->openBatch) {
				throw new Exception('No open batch to commit.');
			}
			$batch = $this->openBatch;
		}

		if ($batch === $this->openBatch) {
			$this->endBatch();
		}

		if (count($batch->getOperations()) < 1) {
			return true;
		}

		return $this->runCommand(new Command\Batch\Commit($this, $batch));
	}

	/**
	 * Delete the given index
	 *
	 * @param Index $index
	 * @return boolean
	 */
	public function deleteIndex(Index $index)
	{
		return $this->runCommand(new Command\DeleteIndex($this, $index));
	}

	/**
	 * Delete the given node
	 *
	 * @param Node $node
	 * @return boolean
	 */
	public function deleteNode(Node $node)
	{
		if ($this->openBatch) {
			$this->openBatch->delete($node);
			return true;
		}

		return $this->runCommand(new Command\DeleteNode($this, $node));
	}

	/**
	 * Delete the given relationship
	 *
	 * @param Relationship $relationship
	 * @return boolean
	 */
	public function deleteRelationship(Relationship $relationship)
	{
		if ($this->openBatch) {
			$this->openBatch->delete($relationship);
			return true;
		}
		return $this->runCommand(new Command\DeleteRelationship($this, $relationship));
	}

	/**
	 * Detach the current open batch.
	 *
	 * The batch can still be committed via the batch returned
	 * by Client::startBatch()
	 *
	 * @return Client
	 */
	public function endBatch()
	{
		$this->openBatch = null;
		return $this;
	}

	/**
	 * Execute the given Cypher query and return the result
	 *
	 * @param Cypher\Query $query A Cypher query, or a query template.
	 * @return Query\ResultSet
	 */
	public function executeCypherQuery(Cypher\Query $query)
	{
		$command = new Command\ExecuteCypherQuery($this, $query);
		return $this->runCommand($command);
	}

	/**
	 * Execute the given Gremlin query and return the result
	 *
	 * @param Gremlin\Query $query
	 * @return Query\ResultSet
	 */
	public function executeGremlinQuery(Gremlin\Query $query)
	{
		$command = new Command\ExecuteGremlinQuery($this, $query);
		return $this->runCommand($command);
	}

	/**
	 * Execute a paged traversal and return the result
	 *
	 * @param Pager $pager
	 * @return array
	 */
	public function executePagedTraversal(Pager $pager)
	{
		$command = new Command\ExecutePagedTraversal($this, $pager);
		return $this->runCommand($command);
	}

	/**
	 * Execute the given traversal and return the result
	 *
	 * @param Traversal $traversal
	 * @param Node $startNode
	 * @param string $returnType
	 * @return array
	 */
	public function executeTraversal(Traversal $traversal, Node $startNode, $returnType)
	{
		$command = new Command\ExecuteTraversal($this, $traversal, $startNode, $returnType);
		return $this->runCommand($command);
	}

	/**
	 * Get the cache
	 *
	 * @return Cache\EntityCache
	 */
	public function getEntityCache()
	{
		if ($this->entityCache === null) {
			$this->setEntityCache(new Cache\EntityCache($this));
		}
		return $this->entityCache;
	}

	/**
	 * Get the entity mapper
	 *
	 * @return EntityMapper
	 */
	public function getEntityMapper()
	{
		if ($this->entityMapper === null) {
			$this->setEntityMapper(new EntityMapper($this));
		}
		return $this->entityMapper;
	}

	/**
	 * Get all indexes of the given type
	 *
	 * @param string $type
	 * @return mixed false on error, else an array of Index objects
	 */
	public function getIndexes($type)
	{
		$command = new Command\GetIndexes($this, $type);
		return $this->runCommand($command);
	}

	/**
	 * List the labels already saved on the server
	 *
	 * If a $node is given, only return labels for
	 * that node.
	 *
	 * @param Node $node
	 * @return array
	 */
	public function getLabels(Node $node=null)
	{
		$command = new Command\GetLabels($this, $node);
		return $this->runCommand($command);
	}

	/**
	 * Get the requested node
	 * Using the $force option disables the check
	 * of whether or not the node exists and will
	 * return a Node with the given id even if it
	 * does not.
	 *
	 * @param integer $id
	 * @param boolean $force
	 * @throws Exception
	 * @return Node
	 */
	public function getNode($id, $force=false)
	{
		$cached = $this->getEntityCache()->getCachedEntity($id, 'node');
		if ($cached) {
			return $cached;
		}

		$node = $this->makeNode();
		$node->setId($id);

		if ($force) {
			return $node;
		}

		try {
			$this->loadNode($node);
		} catch (Exception $e) {
			if ($e->getCode() == self::ErrorNotFound) {
				return null;
			} else {
				throw $e;
			}
		}
		return $node;
	}

	/**
	 * Get all relationships on a node matching the criteria
	 *
	 * @param Node   $node
	 * @param mixed  $types a string or array of strings
	 * @param string $dir
	 * @return mixed false on error, else an array of Relationship objects
	 */
	public function getNodeRelationships(Node $node, $types=array(), $dir=null)
	{
		$command = new Command\GetNodeRelationships($this, $node, $types, $dir);
		return $this->runCommand($command);
	}

	/**
	 * Get the nodes matching the given label
	 *
	 * If a property and value are given, only return
	 * nodes where the given property equals the value
	 *
	 * @param Label  $label
	 * @param string $propertyName
	 * @param mixed  $propertyValue
	 * @return Query\Row
	 */
	public function getNodesForLabel(Label $label, $propertyName=null, $propertyValue=null)
	{
		$command = new Command\GetNodesForLabel($this, $label, $propertyName, $propertyValue);
		return $this->runCommand($command);
	}

	/**
	 * Get an array of paths matching the finder's criteria
	 *
	 * @param PathFinder $finder
	 * @return array
	 */
	public function getPaths(PathFinder $finder)
	{
		$command = new Command\GetPaths($this, $finder);
		return $this->runCommand($command);
	}

	/**
	 * Retrieve the reference node (id: 0) from the server
	 *
	 * @return Node
	 */
	public function getReferenceNode()
	{
		return $this->getNode(self::RefNodeId);
	}

	/**
	 * Get the requested relationship
	 * Using the $force option disables the check
	 * of whether or not the relationship exists and will
	 * return a Relationship with the given id even if it
	 * does not.
	 *
	 * @param integer $id
	 * @param boolean $force
	 * @throws Exception
	 * @return Relationship
	 */
	public function getRelationship($id, $force=false)
	{
		$cached = $this->getEntityCache()->getCachedEntity($id, 'relationship');
		if ($cached) {
			return $cached;
		}

		$rel = $this->makeRelationship();
		$rel->setId($id);

		if ($force) {
			return $rel;
		}


		try {
			$this->loadRelationship($rel);
		} catch (Exception $e) {
			if ($e->getCode() == self::ErrorNotFound) {
				return null;
			} else {
				throw $e;
			}
		}
		return $rel;
	}

	/**
	 * Get a list of all relationship types on the server
	 *
	 * @return array
	 */
	public function getRelationshipTypes()
	{
		$command = new Command\GetRelationshipTypes($this);
		return $this->runCommand($command);
	}

	/**
	 * Retrieve information about the server
	 *
	 * @param boolean $force Don't use previous results
	 * @return array
	 */
	public function getServerInfo($force=false)
	{
		if ($this->serverInfo === null || $force) {
			$command = new Command\GetServerInfo($this);
			$this->serverInfo = $this->runCommand($command);
		}
		return $this->serverInfo;
	}

	/**
	 * Get the transport
	 *
	 * @return Transport
	 */
	public function getTransport()
	{
		return $this->transport;
	}

	/**
	 * Does the connected database have the requested capability?
	 *
	 * @param string $capability
	 * @return mixed true or string if yes, false otherwise
	 */
	public function hasCapability($capability)
	{
		$info = $this->getServerInfo();

		switch ($capability) {
			case self::CapabilityLabel:
			case self::CapabilityTransactions:
				return $info['version']['major'] > 1;

			case self::CapabilityCypher:
				if (isset($info['cypher'])) {
					return $info['cypher'];
				} else if (isset($info['extensions']['CypherPlugin']['execute_query'])) {
					return $info['extensions']['CypherPlugin']['execute_query'];
				}
				return false;

			case self::CapabilityGremlin:
				if (isset($info['extensions']['GremlinPlugin']['execute_script'])) {
					return $info['extensions']['GremlinPlugin']['execute_script'];
				}
				return false;

			default:
				return false;
		}
	}

	/**
	 * Load the given node with data from the server
	 *
	 * @param Node $node
	 * @return boolean
	 */
	public function loadNode(Node $node)
	{
		$cached = $this->getEntityCache()->getCachedEntity($node->getId(), 'node');
		if ($cached) {
			$node->setProperties($cached->getProperties());
			return true;
		}

		return $this->runCommand(new Command\GetNode($this, $node));
	}

	/**
	 * Load the given relationship with data from the server
	 *
	 * @param Relationship $rel
	 * @return boolean
	 */
	public function loadRelationship(Relationship $rel)
	{
		$cached = $this->getEntityCache()->getCachedEntity($rel->getId(), 'relationship');
		if ($cached) {
			$rel->setProperties($cached->getProperties());
			return true;
		}

		return $this->runCommand(new Command\GetRelationship($this, $rel));
	}

	/**
	 * Retrieve a Label object for the given name
	 *
	 * If the name has already been seen, the same
	 * Label object wil be returned, i. e. only one
	 * Label will exist per name.
	 *
	 * @param string $name
	 * @return Label
	 */
	public function makeLabel($name)
	{
		$label = $this->labelCache->get($name);
		if (!$label) {
			$label = new Label($this, $name);
			$this->labelCache->set($name, $label);
		}

		return $label;
	}

	/**
	 * Create a new node object bound to this client
	 *
	 * @param array $properties
	 * @throws Exception
	 * @return Node
	 */
	public function makeNode($properties=array())
	{
		$nodeFactory = $this->nodeFactory;
		$node = $nodeFactory($this, $properties);
		if (!($node instanceof Node)) {
			throw new Exception('Node factory did not return a Node object.');
		}
		return $node->setProperties($properties);
	}

	/**
	 * Create a new relationship object bound to this client
	 *
	 * @param array $properties
	 * @throws Exception
	 * @return Relationship
	 */
	public function makeRelationship($properties=array())
	{
		$relFactory = $this->relFactory;
		$rel = $relFactory($this, $properties);
		if (!($rel instanceof Relationship)) {
			throw new Exception('Relationship factory did not return a Relationship object.');
		}
		return $rel->setProperties($properties);
	}

	/**
	 * Query an index using a query string.
	 * The default query language in Neo4j is Lucene
	 *
	 * @param Index $index
	 * @param string $query
	 * @return array
	 */
	public function queryIndex(Index $index, $query)
	{
		$command = new Command\QueryIndex($this, $index, $query);
		return $this->runCommand($command);
	}

	/**
	 * Rollback the transaction
	 *
	 * @param Transaction $transaction
	 * @return mixed
	 */
	public function rollbackTransaction(Transaction $transaction)
	{
		$command = new Command\RollbackTransaction($this, $transaction);
		return $this->runCommand($command);
	}

	/**
	 * Remove an entity from an index
	 * If $value is not given, all reference of the entity for the key
	 * are removed.
	 * If $key is not given, all reference of the entity are removed.
	 *
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return boolean
	 */
	public function removeFromIndex(Index $index, PropertyContainer $entity, $key=null, $value=null)
	{
		if ($this->openBatch) {
			$this->openBatch->removeFromIndex($index, $entity, $key, $value);
			return true;
		}

		return $this->runCommand(new Command\RemoveFromIndex($this, $index, $entity, $key, $value));
	}

	/**
	 * Remove a set of labels from a node
	 *
	 * @param Node  $node
	 * @param array $labels list of Label objects to remove
	 * @return array of Label objects; the entire list of labels on the given node
	 *   including the ones just added
	 */
	public function removeLabels(Node $node, $labels)
	{
		$command = new Command\RemoveLabels($this, $node, $labels);
		return $this->runCommand($command);
	}

	/**
	 * Save the given index
	 *
	 * @param Index $index
	 * @return boolean
	 */
	public function saveIndex(Index $index)
	{
		return $this->runCommand(new Command\SaveIndex($this, $index));
	}

	/**
	 * Save the given node
	 *
	 * @param Node $node
	 * @return boolean
	 */
	public function saveNode(Node $node)
	{
		if ($this->openBatch) {
			$this->openBatch->save($node);
			return true;
		}

		if ($node->hasId()) {
			return $this->runCommand(new Command\UpdateNode($this, $node));
		} else {
			return $this->runCommand(new Command\CreateNode($this, $node));
		}
	}

	/**
	 * Save the given relationship
	 *
	 * @param Relationship $rel
	 * @return boolean
	 */
	public function saveRelationship(Relationship $rel)
	{
		if ($this->openBatch) {
			$this->openBatch->save($rel);
			return true;
		}

		if ($rel->hasId()) {
			return $this->runCommand(new Command\UpdateRelationship($this, $rel));
		} else {
			return $this->runCommand(new Command\CreateRelationship($this, $rel));
		}
	}

	/**
	 * Search an index for matching entities
	 *
	 * @param Index $index
	 * @param string $key
	 * @param string $value
	 * @return array
	 */
	public function searchIndex(Index $index, $key, $value)
	{
		$command = new Command\SearchIndex($this, $index, $key, $value);
		return $this->runCommand($command);
	}

	/**
	 * Set the cache to use
	 *
	 * @param Cache\EntityCache $cache
	 */
	public function setEntityCache(Cache\EntityCache $cache)
	{
		$this->entityCache = $cache;
	}

	/**
	 * Set the entity mapper to use
	 *
	 * @param EntityMapper $mapper
	 */
	public function setEntityMapper(EntityMapper $mapper)
	{
		$this->entityMapper = $mapper;
	}

	/**
	 * Set the callback to use to create new Node objects
	 *
	 * Takes a callback of the signature callback(Client $client, $properties=array())
	 * and returns a new Node object.
	 * The properties can be used to determine what type of Node
	 * should be returned, but are not set by the factory function.
	 *
	 * @param callable $factory
	 * @throws Exception
	 * @return Client
	 */
	public function setNodeFactory($factory)
	{
		if (!is_callable($factory)) {
			throw new Exception('Node factory must be callable.');
		}

		$this->nodeFactory = $factory;
		return $this;
	}

	/**
	 * Set the callback to use to create new Relationship objects
	 *
	 * Takes a callback of the signature callback(Client $client, $properties=array())
	 * and returns a new Relationship object.
	 * The properties can be used to determine what type of Relationship
	 * should be returned, but are not set by the factory function.
	 *
	 * @param callable $factory
	 * @throws Exception
	 * @return Client
	 */
	public function setRelationshipFactory($factory)
	{
		if (!is_callable($factory)) {
			throw new Exception('Relationship factory must be callable.');
		}

		$this->relFactory = $factory;
		return $this;
	}

	/**
	 * Set the transport to use
	 *
	 * @param Transport $transport
	 */
	public function setTransport(Transport $transport)
	{
		$this->transport = $transport;
	}

	/**
	 * Start an implicit batch
	 *
	 * Any data manipulation calls that occur between this call
	 * and the subsequent Client::commitBatch() call will be
	 * wrapped in a batch operation.
	 *
	 * @return Batch
	 */
	public function startBatch()
	{
		if (!$this->openBatch) {
			$this->openBatch = new Batch($this);
		}
		return $this->openBatch;
	}

	/**
	 * Run a command that will talk to the transport
	 *
	 * @param Command $command
	 * @return mixed
	 */
	protected function runCommand(Command $command)
	{
		$result = $command->execute();
		return $result;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/AddLabels.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command\SetLabels,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Label;

/**
 * Add a set of labels to a node
 */
class AddLabels extends SetLabels
{
	/**
	 * Set the labels to add
	 *
	 * @param Client $client
	 * @param Node   $node
	 * @param array  $labels
	 */
	public function __construct(Client $client, Node $node, $labels)
	{
		parent::__construct($client, $node, $labels, false);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/AddStatementsToTransaction.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Transaction,
	Everyman\Neo4j\Cypher\Query,
	Everyman\Neo4j\Query\ResultSet;

/**
 * Open, add statements to, and/or commit a Cypher transaction
 */
class AddStatementsToTransaction extends Command
{
	protected $transaction = null;
	protected $statements = array();
	protected $commit = false;

	/**
	 * Set the transaction and statements to use
	 *
	 * @param Client $client
	 * @param Transaction $transaction
	 * @param array $statements
	 * @param boolean $commit
	 */
	public function __construct(Client $client, Transaction $transaction, $statements=array(), $commit=false)
	{
		parent::__construct($client);
		$this->transaction = $transaction;
		$this->statements = $statements;
		$this->commit = $commit;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		if (!$this->statements && !$this->transaction->getId()) {
			throw new Exception("Cannot keep-alive a transaction without an id");
		}

		$statements = array_map(array($this, 'formatStatement'), $this->statements);
		return array('statements' => $statements);
	}

	/**
	 * Format the given query into a transactional statement
	 *
	 * @param Query $statement
	 * @return array
	 */
	protected function formatStatement(Query $statement)
	{
		return array(
			'statement'          => $statement->getQuery(),
			'parameters'         => (object)$statement->getParameters(),
			'resultDataContents' => array('rest'),
		);
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->client->hasCapability(Client::CapabilityTransactions)) {
			throw new Exception('Transactions unavailable');
		}

		$path = '/transaction';

		$id = $this->transaction->getId();
		if ($id) {
			$path .= '/'.$id;
		}

		if ($this->commit) {
			$path .= '/commit';
		}

		return $path;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2 || !empty($data['errors'])) {
			$this->throwException('Error in transaction', $code, $headers, $data);
		}

		if (!$this->transaction->getId() && !$this->commit) {
			$this->setTransactionId($data);
		}

		$results = array_map(array($this, 'mapResult'), $data['results']);
		return $results;
	}

	/**
	 * Map the response into a ResultSet
	 *
	 * @param array $result
	 * @return ResultSet
	 */
	protected function mapResult($result)
	{
		$data = array_map(function ($row) {
			return $row['rest'];
		}, $result['data']);

		return new ResultSet($this->client, array(
			'columns' => $result['columns'],
			'data' => $data,
		));
	}

	/**
	 * Parse the transaction id out of the response and set it on the transaction
	 *
	 * @param array $data
	 */
	protected function setTransactionId($data)
	{
		$commit = $data['commit'];
		$path = parse_url($commit, PHP_URL_PATH);
		$parts = explode('/', $path);
		$id = $parts[count($parts)-2];
		$this->transaction->setId($id);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/AddToIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\PropertyContainer,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Index;

/**
 * Add an entity to an index
 */
class AddToIndex extends Command
{
	protected $index = null;
	protected $entity = null;
	protected $key = null;
	protected $value = null;

	/**
	 * Set the index to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 */
	public function __construct(Client $client, Index $index, PropertyContainer $entity, $key, $value)
	{
		parent::__construct($client);
		$this->index = $index;
		$this->entity = $entity;
		$this->key = $key;
		$this->value = $value;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		if (!$this->entity || !$this->entity->hasId()) {
			throw new Exception('No entity to index specified');
		}

		$data = array();

		$type = trim((string)$this->index->getType());
		$data['uri'] = $this->getTransport()->getEndpoint().'/'.$type.'/'.$this->entity->getId();


		$key = trim((string)$this->key);
		if (!$key) {
			throw new Exception('No key specified to add to index');
		}
		$data['key'] = $key;
		$data['value'] = $this->value;

		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$type = trim((string)$this->index->getType());
		if ($type != Index::TypeNode && $type != Index::TypeRelationship) {
			throw new Exception('No type specified for index');
		} else if ($type == Index::TypeNode && !($this->entity instanceof Node)) {
			throw new Exception('Cannot add a node to a non-node index');
		} else if ($type == Index::TypeRelationship && !($this->entity instanceof Relationship)) {
			throw new Exception('Cannot add a relationship to a non-relationship index');
		}

		$name = trim((string)$this->index->getName());
		if (!$name) {
			throw new Exception('No name specified for index');
		}
		$name = rawurlencode($name);

		return '/index/'.$type.'/'.$name;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to add entity to index', $code, $headers, $data);
		}
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/AddToIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index,
	Everyman\Neo4j\Batch,
	Everyman\Neo4j\PropertyContainer,
	Everyman\Neo4j\Command\AddToIndex as SingleAddToIndex;

/**
 * Add the given entity to the index
 * Also creates the entity if necessary
 */
class AddToIndex extends Command
{
	protected $batch = null;
	protected $entity = null;

	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @param integer $opId
	 * @param Batch $batch
	 */
	public function __construct(Client $client, Index $index, PropertyContainer $entity, $key, $value, $opId, Batch $batch)
	{
		parent::__construct($client, new SingleAddToIndex($client, $index, $entity, $key, $value), $opId);
		$this->batch = $batch;
		$this->entity = $entity;
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array();

		// Prevent the command from throwing an Exception if an unsaved entity
		if (!$this->entity->hasId()) {
			$entityId = $this->batch->save($this->entity);
			$reserved = $this->batch->reserve($entityId);
			if ($reserved) {
				$opData = array_merge($opData, $reserved->getCommand()->getData());
			}
			$this->entity->setId(-1);
			$body = $this->base->getData();
			$this->entity->setId(null);
			$body['uri'] = "{{$entityId}}";
		} else {
			$body = $this->base->getData();
		}

		$opData[] = array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'body' => $body,
			'id' => $this->opId,
		);
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/Command.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Command as SingleCommand,
	Everyman\Neo4j\Client;

/**
 * A single command executed in a batch
 */
abstract class Command extends SingleCommand
{
	protected $base = null;
	protected $opId = null;

	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param SingleCommand $base
	 * @param integer $opId
	 */
	public function __construct(Client $client, SingleCommand $base, $opId)
	{
		parent::__construct($client);
		$this->base = $base;
		$this->opId = $opId;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		return '/batch';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return mixed
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to commit batch', $code, $headers, $data);
		}

		foreach ($data as $result) {
			$this->handleSingleResult($result);
		}
		return true;
	}

	/**
	 * Handle a single result from the batch of results
	 *
	 * @param array $result
	 * @return mixed
	 * @throws Exception on failure
	 */
	protected function handleSingleResult($result)
	{
		$headers = array();
		if (isset($result['location'])) {
			$headers['Location'] = $result['location'];
		}
		return $this->base->handleResult(200, $headers, $result);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/Commit.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Batch;

/**
 * Commit a batch operation
 * @todo: Handle the case of empty body or body\data needing to be objects not arrays
 * @todo: Is this really a batch command in itself, or something different?
 */
class Commit extends Command
{
	protected $batch = null;

	/**
	 * Set the batch to drive the command
	 *
	 * @param Client $client
	 * @param Batch $batch
	 */
	public function __construct(Client $client, Batch $batch)
	{
		parent::__construct($client, $this, null);
		$this->batch = $batch;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$operations = $this->batch->getOperations();
		$data = array();
		foreach ($operations as $op) {
			if ($op->reserve()) {
				$opData = $op->getCommand()->getData();
				foreach ($opData as $datum) {
					$data[] = $datum;
				}
			}
		}
		return $data;
	}

	/**
	 * Use the results
	 *
	 * @param array $result
	 */
	protected function handleSingleResult($result)
	{
		$operations = $this->batch->getOperations();
		$command = $operations[$result['id']]->getCommand();
		return $command->handleSingleResult($result);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/CreateNode.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Command\CreateNode as SingleCreateNode;

/**
 * Create a node in a batch
 */
class CreateNode extends Command
{
	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 * @param integer $opId
	 */
	public function __construct(Client $client, Node $node, $opId)
	{
		parent::__construct($client, new SingleCreateNode($client, $node), $opId);
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array(array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'body' => $this->base->getData(),
			'id' => $this->opId,
		));
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/CreateRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Batch,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Command\CreateRelationship as SingleCreateRelationship;

/**
 * Create a relationship in a batch
 * Also creates the endpoint nodes if necessary
 */
class CreateRelationship extends Command
{
	protected $batch = null;
	protected $rel = null;

	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 * @param integer $opId
	 * @param Batch $batch
	 */
	public function __construct(Client $client, Relationship $rel, $opId, Batch $batch)
	{
		parent::__construct($client, new SingleCreateRelationship($client, $rel), $opId);
		$this->batch = $batch;
		$this->rel = $rel;
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array();

		// Prevent the command from throwing an Exception if an unsaved start node
		$startNode = $this->rel->getStartNode();
		if (!$startNode->hasId()) {
			$startId = $this->batch->save($startNode);
			$reserved = $this->batch->reserve($startId);
			if ($reserved) {
				$opData = array_merge($opData, $reserved->getCommand()->getData());
			}
			$start = "{{$startId}}/relationships";
		} else {
			$start = $this->base->getPath();
		}

		// Prevent the command from throwing an Exception if an unsaved end node
		$endNode = $this->rel->getEndNode();
		if (!$endNode->hasId()) {
			$endId = $this->batch->save($endNode);
			$reserved = $this->batch->reserve($endId);
			if ($reserved) {
				$opData = array_merge($opData, $reserved->getCommand()->getData());
			}
			$endNode->setId('temp');
			$data = $this->base->getData();
			$endNode->setId(null);
			$data['to'] = "{{$endId}}";
		} else {
			$data = $this->base->getData();
		}

		$opData[] = array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $start,
			'body' => $data,
			'id' => $this->opId,
		);
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/DeleteNode.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Command\DeleteNode as SingleDeleteNode;

/**
 * Delete a node in a batch
 */
class DeleteNode extends Command
{
	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 * @param integer $opId
	 */
	public function __construct(Client $client, Node $node, $opId)
	{
		parent::__construct($client, new SingleDeleteNode($client, $node), $opId);
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array(array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'id' => $this->opId,
		));
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/DeleteRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Command\DeleteRelationship as SingleDeleteRelationship;

/**
 * Delete a relationship in a batch
 */
class DeleteRelationship extends Command
{
	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 * @param integer $opId
	 */
	public function __construct(Client $client, Relationship $rel, $opId)
	{
		parent::__construct($client, new SingleDeleteRelationship($client, $rel), $opId);
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array(array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'id' => $this->opId,
		));
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/RemoveFromIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index,
	Everyman\Neo4j\Batch,
	Everyman\Neo4j\PropertyContainer,
	Everyman\Neo4j\Command\RemoveFromIndex as SingleRemoveFromIndex;

/**
 * Remove the given entity from the index
 */
class RemoveFromIndex extends Command
{
	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @param integer $opId
	 */
	public function __construct(Client $client, Index $index, PropertyContainer $entity, $key, $value, $opId)
	{
		parent::__construct($client, new SingleRemoveFromIndex($client, $index, $entity, $key, $value), $opId);
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array(array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'id' => $this->opId,
		));
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/UpdateNode.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Command\UpdateNode as SingleUpdateNode;

/**
 * Update a node in a batch
 */
class UpdateNode extends Command
{
	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 * @param integer $opId
	 */
	public function __construct(Client $client, Node $node, $opId)
	{
		parent::__construct($client, new SingleUpdateNode($client, $node), $opId);
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array(array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'body' => $this->base->getData(),
			'id' => $this->opId,
		));
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/Batch/UpdateRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command\Batch;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Command\UpdateRelationship as SingleUpdateRelationship;

/**
 * Update a relationship in a batch
 */
class UpdateRelationship extends Command
{
	/**
	 * Set the operation to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 * @param integer $opId
	 */
	public function __construct(Client $client, Relationship $rel, $opId)
	{
		parent::__construct($client, new SingleUpdateRelationship($client, $rel), $opId);
	}

	/**
	 * Return the data to pass
	 *
	 * @return array
	 */
	protected function getData()
	{
		$opData = array(array(
			'method' => strtoupper($this->base->getMethod()),
			'to' => $this->base->getPath(),
			'body' => $this->base->getData(),
			'id' => $this->opId,
		));
		return $opData;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/CreateNode.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Node;

/**
 * Create a node
 */
class CreateNode extends Command
{
	protected $node = null;

	/**
	 * Set the node to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 */
	public function __construct(Client $client, Node $node)
	{
		parent::__construct($client);
		$this->node = $node;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return $this->node->getProperties() ?: null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		return '/node';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to create node', $code, $headers, $data);
		}

		$nodeId = $this->getEntityMapper()->getIdFromUri($headers['Location']);
		$this->node->setId($nodeId);
		$this->getEntityCache()->setCachedEntity($this->node);
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/CreateRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node;

/**
 * Create a relationship
 */
class CreateRelationship extends Command
{
	protected $rel = null;

	/**
	 * Set the relationship to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 */
	public function __construct(Client $client, Relationship $rel)
	{
		parent::__construct($client);
		$this->rel = $rel;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$end = $this->rel->getEndNode();
		$type = $this->rel->getType();
		if (!$end || !$end->hasId()) {
			throw new Exception('No relationship end node specified');
		} else if (!$type) {
			throw new Exception('No relationship type specified');
		}

		$endUri = $this->getTransport()->getEndpoint().'/node/'.$end->getId();
		$data = array(
			'type' => $type,
			'to'   => $endUri,
		);

		$properties = $this->rel->getProperties();
		if ($properties) {
			$data['data'] = $properties;
		}

		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$start = $this->rel->getStartNode();
		if (!$start || !$start->hasId()) {
			throw new Exception('No relationship start node specified');
		}
		return '/node/'.$start->getId().'/relationships';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to create relationship', $code, $headers, $data);
		}

		$relId = $this->getEntityMapper()->getIdFromUri($headers['Location']);
		$this->rel->setId($relId);
		$this->getEntityCache()->setCachedEntity($this->rel);
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/DeleteIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Index;

/**
 * Create an index
 */
class DeleteIndex extends Command
{
	protected $index = null;

	/**
	 * Set the index to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 */
	public function __construct(Client $client, Index $index)
	{
		parent::__construct($client);
		$this->index = $index;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'delete';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$type = trim((string)$this->index->getType());
		if ($type != Index::TypeNode && $type != Index::TypeRelationship) {
			throw new Exception('No type specified for index');
		}

		$name = trim((string)$this->index->getName());
		if (!$name) {
			throw new Exception('No name specified for index');
		}
		$name = rawurlencode($name);

		return '/index/'.$type.'/'.$name;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2 && (int)$code != 404) {
			$this->throwException('Unable to delete index', $code, $headers, $data);
		}
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/DeleteNode.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Node;

/**
 * Delete a node
 */
class DeleteNode extends Command
{
	protected $node = null;

	/**
	 * Set the node to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 */
	public function __construct(Client $client, Node $node)
	{
		parent::__construct($client);
		$this->node = $node;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'delete';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->node->hasId()) {
			throw new Exception('No node id specified for delete');
		}
		return '/node/'.$this->node->getId();
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$this->getEntityCache()->deleteCachedEntity($this->node);
			return true;
		} else {
			$this->throwException('Unable to delete node', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/DeleteRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship;

/**
 * Delete a relationship
 */
class DeleteRelationship extends Command
{
	protected $rel = null;

	/**
	 * Set the relationship to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 */
	public function __construct(Client $client, Relationship $rel)
	{
		parent::__construct($client);
		$this->rel = $rel;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'delete';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->rel->hasId()) {
			throw new Exception('No relationship id specified for delete');
		}
		return '/relationship/'.$this->rel->getId();
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$this->getEntityCache()->deleteCachedEntity($this->rel);
			return true;
		} else {
			$this->throwException('Unable to delete relationship', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/ExecuteCypherQuery.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Exception,
	Everyman\Neo4j\EntityMapper,
	Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Cypher\Query,
	Everyman\Neo4j\Query\ResultSet;

/**
 * Perform a query using the Cypher query language and return the results
 */
class ExecuteCypherQuery extends Command
{
	protected $query = null;

	/**
	 * Set the query to execute
	 *
	 * @param Client $client
	 * @param Query $query
	 */
	public function __construct(Client $client, Query $query)
	{
		parent::__construct($client);
		$this->query = $query;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$data = array('query' => $this->query->getQuery());
		$params = $this->query->getParameters();
		if ($params) {
			$data['params'] = $params;
		}
		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$url = $this->client->hasCapability(Client::CapabilityCypher);
		if (!$url) {
			throw new Exception('Cypher unavailable');
		}

		return preg_replace('/^.+\/db\/data/', '', $url);
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to execute query', $code, $headers, $data);
		}

		return new ResultSet($this->client, $data);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/ExecuteGremlinQuery.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\EntityMapper,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Gremlin\Query,
	Everyman\Neo4j\Query\ResultSet;

/**
 * Perform a query using the Gremlin DSL and return the results
 */
class ExecuteGremlinQuery extends Command
{
	protected $query = null;

	/**
	 * Set the query to execute
	 *
	 * @param Client $client
	 * @param Query $query
	 */
	public function __construct(Client $client, Query $query)
	{
		parent::__construct($client);
		$this->query = $query;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$data = array('script' => $this->query->getQuery());
		$params = $this->query->getParameters();
		if ($params) {
			$data['params'] = $params;
		}
		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$url = $this->client->hasCapability(Client::CapabilityGremlin);
		if (!$url) {
			throw new Exception('Gremlin unavailable');
		}

		return preg_replace('/^.+\/db\/data/', '', $url);
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to execute query', $code, $headers, $data);
		}

		return new ResultSet($this->client, $this->normalizeData($data));
	}

	/**
	 * Normalize the data so a proper ResultSet can be built
	 * Normalized data has 'data' and 'columns' keys for result set.
	 *
	 * @param array $data
	 * @return array
	 */
	protected function normalizeData($data)
	{
		if (is_scalar($data)) {
			$data = array($data);
		}

		if (!array_key_exists('columns', $data)) {
			$columns = array(0);

			if (array_key_exists('self', $data)) {
				$data = array(array($data));
			} else {
				foreach ($data as $i => $entity) {
					$data[$i] = array($entity);
				}
			}

			$data = array(
				'columns' => $columns,
				'data' => $data
			);
		}

		return $data;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/ExecutePagedTraversal.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Pager;

/**
 * Perform a paged traversal and return the results
 */
class ExecutePagedTraversal extends ExecuteTraversal
{
	protected $pager = null;

	/**
	 * Set the pager to execute
	 *
	 * @param Client $client
	 * @param Pager $pager
	 */
	public function __construct(Client $client, Pager $pager)
	{
		parent::__construct($client, $pager->getTraversal(), $pager->getStartNode(), $pager->getReturnType());
		$this->pager = $pager;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return $this->pager->getId() ? null : parent::getData();
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return $this->pager->getId() ? 'get' : parent::getMethod();
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$path = parent::getPath();
		$path = str_replace('traverse', 'paged/traverse', $path);

		$id = $this->pager->getId();
		if ($id) {
			$path .= "/{$id}";
		} else {
			$queryParams = array();
			$pageSize = $this->pager->getPageSize();
			$leaseTime = $this->pager->getLeaseTime();
			if ($pageSize) {
				$queryParams['pageSize'] = $pageSize;
			}
			if ($leaseTime) {
				$queryParams['leaseTime'] = $leaseTime;
			}
			$queryString = http_build_query($queryParams);
			$path .= $queryString ? "?{$queryString}" : '';
		}

		return $path;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if (isset($headers['Location'])) {
			$traversalId = $this->getEntityMapper()->getIdFromUri($headers['Location']);
			$this->pager->setId($traversalId);
		}

		// No results found or end of result set indicated by not found
		if ($code == Client::ErrorNotFound) {
			return null;
		}
		return parent::handleResult($code, $headers, $data);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/ExecuteTraversal.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Traversal,
	Everyman\Neo4j\Path,
	Everyman\Neo4j\Node;

/**
 * Perform a traversal and return the results
 */
class ExecuteTraversal extends Command
{
	protected $traversal = null;
	protected $node = null;
	protected $returnType = null;

	protected $results;

	/**
	 * Set the traversal to execute
	 *
	 * @param Client $client
	 * @param Traversal $traversal
	 * @param Node $node
	 * @param string $returnType
	 */
	public function __construct(Client $client, Traversal $traversal, Node $node, $returnType)
	{
		parent::__construct($client);
		$this->traversal = $traversal;
		$this->node = $node;
		$this->returnType = $returnType;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$data = array();

		$order = $this->traversal->getOrder();
		if ($order) {
			$data['order'] = $order;
		}

		$uniqueness = $this->traversal->getUniqueness();
		if ($uniqueness) {
			$data['uniqueness'] = $uniqueness;
		}

		$maxDepth = $this->traversal->getMaxDepth();
		if ($maxDepth) {
			$data['max_depth'] = $maxDepth;
		}

		$relationships = $this->traversal->getRelationships();
		if (count($relationships) > 0) {
			$data['relationships'] = $relationships;
		}

		$prune = $this->traversal->getPruneEvaluator();
		if ($prune) {
			if ($prune['language'] == Traversal::Builtin) {
				$prune['name'] = $prune['body'];
				unset($prune['body']);
			}
			$data['prune_evaluator'] = $prune;
		}

		$filter = $this->traversal->getReturnFilter();
		if ($filter) {
			if ($filter['language'] == Traversal::Builtin) {
				$filter['name'] = $filter['body'];
				unset($filter['body']);
			}
			$data['return_filter'] = $filter;
		}

		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->node->hasId()) {
			throw new Exception('No node id specified');
		}

		if ($this->returnType != Traversal::ReturnTypeNode
			&& $this->returnType != Traversal::ReturnTypeRelationship
			&& $this->returnType != Traversal::ReturnTypePath
			&& $this->returnType != Traversal::ReturnTypeFullPath) {
			throw new Exception('No return type specified for traversal');
		}

		return '/node/'.$this->node->getId().'/traverse/'.$this->returnType;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to execute traversal', $code, $headers, $data);
		}

		$this->results = array();
		if ($this->returnType == Traversal::ReturnTypeNode) {
			$this->handleNodes($data);
		} else if ($this->returnType == Traversal::ReturnTypeRelationship) {
			$this->handleRelationships($data);
		} else if ($this->returnType == Traversal::ReturnTypePath) {
			$this->handlePaths($data);
		} else if ($this->returnType == Traversal::ReturnTypeFullPath) {
			$this->handlePaths($data, true);
		}
		return $this->results;
	}

	/**
	 * Handle nodes
	 *
	 * @param array $data
	 */
	protected function handleNodes($data)
	{
		foreach ($data as $nodeData) {
			$this->results[] = $this->getEntityMapper()->makeNode($nodeData);
		}
	}

	/**
	 * Handle relationships
	 *
	 * @param array $data
	 */
	protected function handleRelationships($data)
	{
		foreach ($data as $relData) {
			$this->results[] = $this->getEntityMapper()->makeRelationship($relData);
		}
	}

	/**
	 * Handle paths
	 *
	 * @param array   $data
	 * @param boolean $full
	 */
	protected function handlePaths($data, $full=false)
	{
		foreach ($data as $pathData) {
			foreach ($data as $pathData) {
				$this->results[] = $this->getEntityMapper()->populatePath(new Path($this->client), $pathData, $full);
			}
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetIndexes.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Index,
	Everyman\Neo4j\Exception;

/**
 * Get all indexes of the requested type known by the server
 */
class GetIndexes extends Command
{
	protected $type = null;

	/**
	 * Set the type of index to retrieve
	 *
	 * @param Client $client
	 * @param string $type
	 */
	public function __construct(Client $client, $type)
	{
		parent::__construct($client);
		$this->type = $type;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$type = trim((string)$this->type);
		if ($type != Index::TypeNode && $type != Index::TypeRelationship) {
			throw new Exception('No type specified for index');
		}

		return '/index/'.$type;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to retrieve indexes', $code, $headers, $data);
		}

		if (!$data) {
			$data = array();
		}

		$indexes = array();
		foreach ($data as $name => $indexData) {
			$indexes[] = new Index($this->client, $this->type, $name, $indexData);
		}
		return $indexes;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetLabels.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Node;

/**
 * List all labels on the server
 */
class GetLabels extends Command
{
	protected $node;

	/**
	 * Optionally provide a node to limit to
	 *
	 * @param Client $client
	 * @param Node   $node
	 */
	public function __construct(Client $client, Node $node=null)
	{
		parent::__construct($client);
		$this->node = $node;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->client->hasCapability(Client::CapabilityLabel)) {
			throw new \RuntimeException('The connected Neo4j version does not have label capability');
		}

		$path = "/labels";
		if ($this->node) {
			$id = $this->node->getId();
			if (!is_numeric($id)) {
				throw new \InvalidArgumentException("Node given with no id");
			}

			$path = "/node/{$id}{$path}";
		}
		return $path;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return Row
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to labels', $code, $headers, $data);
		}

		$labels = array_map(array($this->client, 'makeLabel'), $data);

		return $labels;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetNode.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Node;

/**
 * Get and populate a node
 */
class GetNode extends Command
{
	protected $node = null;

	/**
	 * Set the node to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 */
	public function __construct(Client $client, Node $node)
	{
		parent::__construct($client);
		$this->node = $node;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->node->hasId()) {
			throw new Exception('No node id specified');
		}
		return '/node/'.$this->node->getId();
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$this->node = $this->getEntityMapper()->populateNode($this->node, $data);
			$this->getEntityCache()->setCachedEntity($this->node);
			return true;
		} else {
			$this->throwException('Unable to retrieve node', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetNodeRelationships.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node;

/**
 * Find relationships on a node
 */
class GetNodeRelationships extends Command
{
	protected $node  = null;
	protected $types = null;
	protected $dir   = null;

	/**
	 * Set the parameters to search
	 *
	 * @param Client $client
	 * @param Node   $node
	 * @param mixed  $types a string or array of strings
	 * @param string $dir
	 */
	public function __construct(Client $client, Node $node, $types=array(), $dir=null)
	{
		parent::__construct($client);

		if (empty($dir)) {
			$dir = Relationship::DirectionAll;
		}
		if (empty($types)) {
			$types = array();
		} else if (!is_array($types)) {
			$types = array($types);
		}

		$this->node = $node;
		$this->dir = $dir;
		$this->types = $types;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->node->hasId()) {
			throw new Exception('No node id specified');
		}

		$path = '/node/'.$this->node->getId().'/relationships/'.$this->dir;
		if (!empty($this->types)) {
			$types = array_map('rawurlencode', $this->types);
			$path .= '/'.join('&', $types);
		}

		return $path;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$rels = array();
			foreach ($data as $relData) {
				$rels[] = $this->getEntityMapper()->makeRelationship($relData);
			}
			return $rels;
		} else {
			$this->throwException('Unable to retrieve node relationships', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetNodesForLabel.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Label,
	Everyman\Neo4j\Query\Row;

/**
 * Find nodes with the given label
 */
class GetNodesForLabel extends Command
{
	protected $label           = null;
	protected $propertyName    = null;
	protected $propertyValue   = null;

	/**
	 * Set the parameters to search
	 *
	 * @param Client $client
	 * @param Label  $label
	 * @param string $propertyName
	 * @param mixed  $propertyValue
	 */
	public function __construct(Client $client, Label $label, $propertyName=null, $propertyValue=null)
	{
		parent::__construct($client);

		$this->label = $label;
		$this->propertyName = $propertyName;
		$this->propertyValue = $propertyValue;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->client->hasCapability(Client::CapabilityLabel)) {
			throw new \RuntimeException('The connected Neo4j version does not have label capability');
		}

		$labelName = rawurlencode($this->label->getName());
		$path = "/label/{$labelName}/nodes";
		if ($this->propertyName || $this->propertyValue) {
			if (!$this->propertyName || !$this->propertyValue) {
				throw new \InvalidArgumentException('Cannot specify a property name without a value, or vice versa');
			}

			$propertyName = rawurlencode($this->propertyName);

			if (is_numeric($this->propertyValue)) {
				$propertyValue = rawurlencode($this->propertyValue);
			} else {
				$propertyValue = rawurlencode('"'.$this->propertyValue.'"');
			}

			$path .= "?{$propertyName}={$propertyValue}";
		}
		return $path;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return Row
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to retrieve nodes for label', $code, $headers, $data);
		}

		return new Row($this->client, array_keys($data), $data);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetPaths.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\PathFinder,
	Everyman\Neo4j\Path;

/**
 * Find paths from one node to another
 */
class GetPaths extends Command
{
	protected $finder = null;

	/**
	 * Set the parameters to search
	 *
	 * @param Client     $client
	 * @param PathFinder $finder
	 */
	public function __construct(Client $client, PathFinder $finder)
	{
		parent::__construct($client);

		$this->finder = $finder;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$data = array();

		$end = $this->finder->getEndNode();
		if (!$end || !$end->hasId()) {
			throw new Exception('No end node id specified');
		}

		$endUri = $this->getTransport()->getEndpoint().'/node/'.$end->getId();
		$data['to'] = $endUri;

		$algo = $this->finder->getAlgorithm();
		if ($algo == PathFinder::AlgoDijkstra) {
			$property = $this->finder->getCostProperty();
			if (!$property) {
				throw new Exception('No cost property specified for Dijkstra path search');
			}
			$data['cost_property'] = $property;
			$data['cost property'] = $property;

			$cost = $this->finder->getDefaultCost();
			if ($cost) {
				$data['default_cost'] = $cost;
				$data['default cost'] = $cost;
			}
		}
		$data['algorithm'] = $algo;



		$max = $this->finder->getMaxDepth();
		if (!$max) {
			$max = 1;
		}
		$data['max_depth'] = $max;
		$data['max depth'] = $max;

		$type = $this->finder->getType();
		$dir = $this->finder->getDirection();
		if ($dir && !$type) {
			throw new Exception('No relationship type specified');
		} else if ($type) {
			$rel = array('type'=>$type);
			if ($dir) {
				$rel['direction'] = $dir;
			}
			$data['relationships'] = $rel;
		}

		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$start = $this->finder->getStartNode();
		if (!$start || !$start->hasId()) {
			throw new Exception('No start node id specified');
		}

		return '/node/'.$start->getId().'/paths';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to retrieve paths', $code, $headers, $data);
		}

		$paths = array();
		foreach ($data as $pathData) {
			$paths[] = $this->getEntityMapper()->populatePath(new Path($this->client), $pathData);
		}
		return $paths;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node;

/**
 * Get and populate a relationship
 */
class GetRelationship extends Command
{
	protected $rel = null;

	/**
	 * Set the relationship to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 */
	public function __construct(Client $client, Relationship $rel)
	{
		parent::__construct($client);
		$this->rel = $rel;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->rel->hasId()) {
			throw new Exception('No relationship id specified');
		}
		return '/relationship/'.$this->rel->getId();
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$this->rel = $this->getEntityMapper()->populateRelationship($this->rel, $data);
			$this->getEntityCache()->setCachedEntity($this->rel);
			return true;
		} else {
			$this->throwException('Unable to retrieve relationship', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetRelationshipTypes.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client;

/**
 * Get all relationship types known by the server
 */
class GetRelationshipTypes extends Command
{
	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		return '/relationship/types';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to retrieve relationship types', $code, $headers, $data);
		}
		return $data;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/GetServerInfo.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client;

/**
 * Get information about the server
 */
class GetServerInfo extends Command
{
	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		return '/';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to retrieve server info', $code, $headers, $data);
		}
		$data['version'] = $this->parseVersion($data['neo4j_version']);
		return $data;
	}

	/**
	 * Parse the version into usable bits
	 *
	 * @param string $fullVersion
	 * @return array
	 */
	protected function parseVersion($fullVersion)
	{
		$parts = explode('.', $fullVersion);
		$versionInfo = array(
			'full'  => $fullVersion,
			'major' => $parts[0],
			'minor' => $parts[1],
		);
		if (empty($parts[2])) {
			$versionInfo['release'] = 'GA';
		} else {
			$versionInfo['release'] = current(explode('-', $parts[2], 2));
		}
		return $versionInfo;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/QueryIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Index;

/**
 * Queries for entities in an index
 */
class QueryIndex extends SearchIndex
{
	/**
	 * Set the index to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 * @param string $query
	 */
	public function __construct(Client $client, Index $index, $query)
	{
		parent::__construct($client, $index, $query, null);
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$path = parent::getPath();
		$path = join('/', array_slice(explode('/', $path), 0, 4));
		$query = rawurlencode($this->key);
		return $path . '?query=' . $query;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/RemoveFromIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\PropertyContainer,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Index;

/**
 * Removes an entity from an index
 */
class RemoveFromIndex extends Command
{
	protected $index = null;
	protected $entity = null;
	protected $key = null;
	protected $value = null;

	/**
	 * Remove an entity from an index
	 * If $value is not given, all reference of the entity for the key
	 * are removed.
	 * If $key is not given, all reference of the entity are removed.
	 *
	 * @param Client $client
	 * @param Index $index
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return boolean
	 */
	public function __construct(Client $client, Index $index, PropertyContainer $entity, $key=null, $value=null)
	{
		parent::__construct($client);
		$this->index = $index;
		$this->entity = $entity;
		$this->key = $key;
		$this->value = $value;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'delete';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->entity || !$this->entity->hasId()) {
			throw new Exception('No entity to index specified');
		}

		$type = trim((string)$this->index->getType());
		if ($type != Index::TypeNode && $type != Index::TypeRelationship) {
			throw new Exception('No type specified for index');
		} else if ($type == Index::TypeNode && !($this->entity instanceof Node)) {
			throw new Exception('Cannot remove a node from a non-node index');
		} else if ($type == Index::TypeRelationship && !($this->entity instanceof Relationship)) {
			throw new Exception('Cannot remove a relationship from a non-relationship index');
		}

		$name = trim((string)$this->index->getName());
		if (!$name) {
			throw new Exception('No name specified for index');
		}

		$name = rawurlencode($name);
		$key = trim((string)$this->key);
		$value = trim((string)$this->value);

		$uri = '/index/'.$type.'/'.$name.'/';
		if ($key) {
			$uri .= rawurlencode($key).'/';
			if ($value) {
				$uri .= rawurlencode($value).'/';
			}
		}
		$uri .= $this->entity->getId();

		return $uri;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to remove entity from index', $code, $headers, $data);
		}
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/RemoveLabels.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command\SetLabels,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Label;

/**
 * Remove a set of labels from a node
 */
class RemoveLabels extends SetLabels
{
	/**
	 * Set the labels to remove
	 *
	 * @param Client $client
	 * @param Node   $node
	 * @param array  $labels
	 */
	public function __construct(Client $client, Node $node, $labels)
	{
		parent::__construct($client, $node, $labels, true);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/RollbackTransaction.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Transaction;

/**
 * Rollback an open Cypher transaction
 */
class RollbackTransaction extends Command
{
	protected $transaction = null;

	/**
	 * Set the transaction to rollback
	 *
	 * @param Client $client
	 * @param Transaction $transaction
	 */
	public function __construct(Client $client, Transaction $transaction)
	{
		parent::__construct($client);
		$this->transaction = $transaction;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'delete';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->client->hasCapability(Client::CapabilityTransactions)) {
			throw new Exception('Transactions unavailable');
		}

		$id = $this->transaction->getId();
		if (!$id) {
			throw new Exception('Cannot rollback a transaction without a transaction id');
		}

		$path = '/transaction/'.$id;

		return $path;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Error during transaction rollback', $code, $headers, $data);
		}

		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/SaveIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Index;

/**
 * Create an index
 */
class SaveIndex extends Command
{
	protected $index = null;

	/**
	 * Set the index to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 */
	public function __construct(Client $client, Index $index)
	{
		parent::__construct($client);
		$this->index = $index;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		$name = trim((string)$this->index->getName());
		if (!$name) {
			throw new Exception('No name specified for index');
		}
		$data = array('name' => $name);

		$config = $this->index->getConfig();
		if ($config) {
			$data['config'] = $config;
		}

		return $data;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'post';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$type = trim((string)$this->index->getType());
		if ($type != Index::TypeNode && $type != Index::TypeRelationship) {
			throw new Exception('No type specified for index');
		}

		return '/index/'.$type;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to save index', $code, $headers, $data);
		}
		return true;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/SearchIndex.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Index;

/**
 * Search for entities in an index
 */
class SearchIndex extends Command
{
	protected $index = null;
	protected $key = null;
	protected $value = null;

	/**
	 * Set the index to drive the command
	 *
	 * @param Client $client
	 * @param Index $index
	 * @param string $key
	 * @param string $value
	 */
	public function __construct(Client $client, Index $index, $key, $value)
	{
		parent::__construct($client);
		$this->index = $index;
		$this->key = $key;
		$this->value = $value;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return null;
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'get';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		$type = trim((string)$this->index->getType());
		if ($type != Index::TypeNode && $type != Index::TypeRelationship) {
			throw new Exception('No type specified for index');
		}

		$name = trim((string)$this->index->getName());
		if (!$name) {
			throw new Exception('No name specified for index');
		}

		$key = trim((string)$this->key);
		if (!$key) {
			throw new Exception('No key specified to search index');
		}

		$name = rawurlencode($name);
		$key = rawurlencode($key);
		$value = rawurlencode($this->value);

		return '/index/'.$type.'/'.$name.'/'.$key.'/'.$value;
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return integer on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) != 2) {
			$this->throwException('Unable to search index', $code, $headers, $data);
		}

		$buildMethod = $this->index->getType() == Index::TypeNode ? 'makeNode' : 'makeRelationship';
		$results = array();
		foreach ($data as $entityData) {
			$results[] = $this->getEntityMapper()->$buildMethod($entityData);
		}
		return $results;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/SetLabels.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command\ExecuteCypherQuery,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Cypher\Query,
	Everyman\Neo4j\Label;

/**
 * Add or remove a set of labels on a node
 *
 * @todo: Don't extend ExecuteCypherQuery, extract and use a more generic Command interface
 *        that proxies to an ExecuteCypherQuery command
 */
class SetLabels extends ExecuteCypherQuery
{
	/**
	 * Proxy creation to a cypher query that does what we want
	 *
	 * @param Client   $client
	 * @param Node     $node
	 * @param array    $labels
	 * @param boolean  $remove
	 */
	public function __construct(Client $client, Node $node, $labels, $remove=false)
	{
		if (!$client->hasCapability(Client::CapabilityLabel)) {
			throw new \RuntimeException('The connected Neo4j version does not have label capability');
		}

		$nodeId = $node->getId();
		if (!is_numeric($nodeId)) {
			throw new \InvalidArgumentException("Cannot set labels on an unsaved node");
		}

		if (!$labels) {
			throw new \InvalidArgumentException("No labels given to set on node");
		}

		$labelSet = implode(':', array_map(function ($label) {
			if (!($label instanceof Label)) {
				throw new \InvalidArgumentException("Cannot set a non-label");
			}
			$name = str_replace('`', '``', $label->getName());
			return "`{$name}`";
		}, $labels));

		$setCommand = $remove ? 'REMOVE' : 'SET';

		$query = "START n=node({nodeId}) {$setCommand} n:{$labelSet} RETURN labels(n) AS labels";
		$params = array('nodeId' => $nodeId);

		$cypher = new Query($client, $query, $params);
		parent::__construct($client, $cypher);
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return array of Label
	 */
	protected function handleResult($code, $headers, $data)
	{
		$results = parent::handleResult($code, $headers, $data);

		$nodeLabels = array();
		foreach ($results[0]['labels'] as $labelName) {
			$nodeLabels[] = $this->client->makeLabel($labelName);
		}
		return $nodeLabels;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/UpdateNode.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Node;

/**
 * Update a node
 */
class UpdateNode extends Command
{
	protected $node = null;

	/**
	 * Set the node to drive the command
	 *
	 * @param Client $client
	 * @param Node $node
	 */
	public function __construct(Client $client, Node $node)
	{
		parent::__construct($client);
		$this->node = $node;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return $this->node->getProperties();
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'put';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->node->hasId()) {
			throw new Exception('No node id specified');
		}
		return '/node/'.$this->node->getId().'/properties';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$this->getEntityCache()->setCachedEntity($this->node);
			return true;
		} else {
			$this->throwException('Unable to update node', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command/UpdateRelationship.php
================================================
<?php
namespace Everyman\Neo4j\Command;

use Everyman\Neo4j\Command,
	Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Relationship;

/**
 * Update a relationship's properties
 */
class UpdateRelationship extends Command
{
	protected $rel = null;

	/**
	 * Set the relationship to drive the command
	 *
	 * @param Client $client
	 * @param Relationship $rel
	 */
	public function __construct(Client $client, Relationship $rel)
	{
		parent::__construct($client);
		$this->rel = $rel;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	protected function getData()
	{
		return $this->rel->getProperties();
	}

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	protected function getMethod()
	{
		return 'put';
	}

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	protected function getPath()
	{
		if (!$this->rel->hasId()) {
			throw new Exception('No relationship id specified');
		}
		return '/relationship/'.$this->rel->getId().'/properties';
	}

	/**
	 * Use the results
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return boolean true on success
	 * @throws Exception on failure
	 */
	protected function handleResult($code, $headers, $data)
	{
		if ((int)($code / 100) == 2) {
			$this->getEntityCache()->setCachedEntity($this->rel);
			return true;
		} else {
			$this->throwException('Unable to update relationship', $code, $headers, $data);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Command.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Abstract the parameters needed to make a request and parse the response
 */
abstract class Command
{
	protected $client;

	/**
	 * Set the client
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	/**
	 * Return the data to pass
	 *
	 * @return mixed
	 */
	abstract protected function getData();

	/**
	 * Return the transport method to call
	 *
	 * @return string
	 */
	abstract protected function getMethod();

	/**
	 * Return the path to use
	 *
	 * @return string
	 */
	abstract protected function getPath();

	/**
	 * Use the results in some way
	 *
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @return mixed
	 * @throws Exception on failure
	 */
	abstract protected function handleResult($code, $headers, $data);

	/**
	 * Run the command and return a value signalling the result
	 *
	 * @return mixed
	 * @throws Exception on failure
	 */
	public function execute()
	{
		$method = $this->getMethod();
		$path = $this->getPath();
		$data = $this->getData();
		$result = $this->getTransport()->$method($path, $data);

		$resultCode = isset($result['code']) ? $result['code'] : Client::ErrorUnknown;
		$resultHeaders = isset($result['headers']) ? $result['headers'] : array();
		$resultData = isset($result['data']) ? $result['data'] : array();
		$parseResult = $this->handleResult($resultCode, $resultHeaders, $resultData);

		return $parseResult;
	}

	/**
	 * Get the entity cache
	 *
	 * @return Cache\EntityCache
	 */
	protected function getEntityCache()
	{
		return $this->client->getEntityCache();
	}

	/**
	 * Get the entity mapper
	 *
	 * @return EntityMapper
	 */
	protected function getEntityMapper()
	{
		return $this->client->getEntityMapper();
	}

	/**
	 * Get the transport
	 *
	 * @return Transport
	 */
	protected function getTransport()
	{
		return $this->client->getTransport();
	}

	/**
	 * Throw an exception from handling the results
	 *
	 * @param string  $message
	 * @param integer $code
	 * @param array   $headers
	 * @param array   $data
	 * @throws Exception
	 */
	protected function throwException($message, $code, $headers, $data)
	{
		$message = "{$message} [{$code}]:\nHeaders: " . print_r($headers, true) . "Body: " . print_r($data, true);
		throw new Exception($message, $code, $headers, $data);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Cypher/Query.php
================================================
<?php
namespace Everyman\Neo4j\Cypher;

use Everyman\Neo4j;

/**
 * Represents a Cypher query string and variables
 * Query the database using Cypher. For query syntax, please refer
 * to the Cypher documentation for your server version.
 *
 * Latest documentation:
 * http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html
 */
class Query implements Neo4j\Query
{
	protected $client = null;
	protected $template = null;
	protected $vars = array();

	protected $result = null;

	/**
	 * Set the template to use
	 *
	 * @param Neo4j\Client $client
	 * @param string $template A Cypher query string or template
	 * @param array $vars Replacement vars to inject into the query
	 */
	public function __construct(Neo4j\Client $client, $template, $vars=array())
	{
		$this->client = $client;
		$this->template = $template;
		$this->vars = $vars;
	}

	/**
	 * Get the query script
	 *
	 * @return string
	 */
	public function getQuery()
	{
		return $this->template;
	}

	/**
	 * Get the template parameters
	 *
	 * @return array
	 */
	public function getParameters()
	{
		return $this->vars;
	}

	/**
	 * Retrieve the query results
	 *
	 * @return Neo4j\Query\ResultSet
	 */
	public function getResultSet()
	{
		if ($this->result === null) {
			$this->result = $this->client->executeCypherQuery($this);
		}

		return $this->result;
	}
}


================================================
FILE: lib/Everyman/Neo4j/EntityMapper.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Used to convert arbitrary arrays into Nodes and Relationships
 * where appropriate. 
 */
class EntityMapper
{
	protected $client = null;

	/**
	 * Set the client for retrieving related entities
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	/**
	 * Given any object, see if it fulfills the contract
	 * for being a path, node or relationship data returned by the
	 * server. If so, return a full Path, Node or Relationship instance.
	 * Else, return the value untainted.
	 *
	 * @param mixed $value
	 * @return mixed
	 */
	public function getEntityFor($value)
	{
		if (is_array($value)) {
			if (array_key_exists('self', $value)) {
				if (array_key_exists('type', $value)) {
					$value = $this->makeRelationship($value);
				} else {
					$value = $this->makeNode($value);
				}
			} else if (array_key_exists('nodes', $value) && array_key_exists('relationships', $value)) {
				$value = $this->populatePath(new Path($this->client), $value);
			}
		}
		return $value;
	}

	/**
	 * Get an id from a URI
	 *
	 * @param string $uri
	 * @return mixed
	 */
	public function getIdFromUri($uri)
	{
		$uriParts = explode('/', $uri);
		return array_pop($uriParts);
	}

	/**
	 * Generate and populate a node from the given data
	 *
	 * @param array $data
	 * @return Node
	 */
	public function makeNode($data)
	{
		$node = $this->getNodeFromUri($data['self']);
		return $this->populateNode($node, $data);
	}

	/**
	 * Generate and populate a relationship from the given data
	 *
	 * @param array $data
	 * @return Relationship
	 */
	public function makeRelationship($data)
	{
		$rel = $this->getRelationshipFromUri($data['self']);
		return $this->populateRelationship($rel, $data);
	}

	/**
	 * Fill a node with data
	 *
	 * @param Node $node
	 * @param array $data
	 * @return Node
	 */
	public function populateNode(Node $node, $data)
	{
		$node->useLazyLoad(false);
		$node->setProperties($data['data']);
		return $node;
	}

	/**
	 * Fill a path with data
	 *
	 * @param Path $path
	 * @param array $data
	 * @param boolean $full
	 * @return Path
	 */
	public function populatePath(Path $path, $data, $full=false)
	{
		foreach ($data['relationships'] as $relData) {
			$relUri = $full ? $relData['self'] : $relData;
			$rel = $this->getRelationshipFromUri($relUri);
			if ($full) {
				$rel = $this->populateRelationship($rel, $relData);
			}
			$path->appendRelationship($rel);
		}

		foreach ($data['nodes'] as $nodeData) {
			$nodeUri = $full ? $nodeData['self'] : $nodeData;
			$node = $this->getNodeFromUri($nodeUri);
			if ($full) {
				$node = $this->populateNode($node, $nodeData);
			}
			$path->appendNode($node);
		}

		return $path;
	}

	/**
	 * Fill a relationship with data
	 *
	 * @param Relationship $rel
	 * @param array $data
	 * @return Relationship
	 */
	public function populateRelationship(Relationship $rel, $data)
	{
		$rel->useLazyLoad(false);
		$rel->setProperties($data['data']);
		$rel->setType($data['type']);

		$rel->setStartNode($this->getNodeFromUri($data['start']));
		$rel->setEndNode($this->getNodeFromUri($data['end']));

		return $rel;
	}

	/**
	 * Retrieve a node by it's 'self' uri
	 *
	 * @param string $uri
	 * @return Node
	 */
	protected function getNodeFromUri($uri)
	{
		$nodeId = $this->getIdFromUri($uri);
		return $this->client->getNode($nodeId, true);
	}

	/**
	 * Retrieve a relationship by it's 'self' uri
	 *
	 * @param string $uri
	 * @return Relationship
	 */
	protected function getRelationshipFromUri($uri)
	{
		$relId = $this->getIdFromUri($uri);
		return $this->client->getRelationship($relId, true);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Exception.php
================================================
<?php
namespace Everyman\Neo4j;

class Exception extends \Exception
{
	protected $headers;
	protected $data;

	public function __construct($message, $code=0, $headers=array(), $data=array())
	{
		$this->headers = $headers;
		$this->data = $data;
		parent::__construct($message, $code);
	}

	/**
	 * Return response headers
	 * @return array Response headers
	 */
	public function getHeaders()
	{
		return $this->headers;
	}

	/**
	 * Return response data
	 * @return array Response data
	 */
	public function getData()
	{
		return $this->data;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Geoff/Exporter.php
================================================
<?php
namespace Everyman\Neo4j\Geoff;

use Everyman\Neo4j\Exception,
	Everyman\Neo4j\Path;

/**
 * Export an array of Paths to a file
 */
class Exporter
{
	/**
	 * Dump an array of Paths
	 *
	 * @param mixed $paths a single Path object or an array of Path objects
	 * @param stream $handle
	 */
	public function dump($paths, $handle)
	{
		if (!is_resource($handle) || get_resource_type($handle) != 'stream') {
			throw new Exception("Not a stream resource");
		}

		if (!is_array($paths)) {
			$paths = array($paths);
		}

		$nodes = array();
		$rels = array();
		foreach ($paths as $path) {
			if (!($path instanceof Path)) {
				throw new Exception("Not a Path");
			}

			$pathNodes = $path->getNodes();
			foreach ($pathNodes as $node) {
				$nodes[$node->getId()] = $node;
			}

			$pathRels = $path->getRelationships();
			foreach ($pathRels as $rel) {
				$rels[$rel->getId()] = $rel;
			}
		}

		foreach ($nodes as $id => $node) {
			$properties = $node->getProperties();
			$format = $properties ? "(%s)\t%s\n" : "(%s)\n";
			fprintf(
				$handle,
				$format,
				$id,
				json_encode($properties)
			);
		}

		foreach ($rels as $id => $rel) {
			$properties = $rel->getProperties();
			$format = "(%s)-[%s:%s]->(%s)";
			$format .= $properties ? "\t%s\n" : "\n";
			fprintf(
				$handle,
				$format,
				$rel->getStartNode()->getId(),
				$id,
				$rel->getType(),
				$rel->getEndNode()->getId(),
				json_encode($properties)
			);
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Geoff/Importer.php
================================================
<?php
namespace Everyman\Neo4j\Geoff;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Exception,
	Everyman\Neo4j\Node,
	Everyman\Neo4j\Relationship,
	Everyman\Neo4j\Index,
	Everyman\Neo4j\Batch;

/**
 * Import a GEOFF file into a batch
 */
class Importer
{
	protected $client = null;

	/**
	 * Build the importer
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}


	/**
	 * Load a GEOFF string from a stream
	 * If a batch is provided, append imported data to it,
	 * else, create and return a new batch
	 *
	 * @param stream $handle
	 * @param Batch $batch
	 * @return Batch
	 */
	public function load($handle, Batch $batch=null)
	{
		if (!is_resource($handle) || get_resource_type($handle) != 'stream') {
			throw new Exception("Not a stream resource");
		}

		if (!$batch) {
			$batch = new Batch($this->client);
		}

		$i = 0;
		$nodes = array();
		$rels = array();
		while (($line = fgets($handle)) !== false) {
			$this->loadLine($line, $batch, $i, $nodes, $rels);
			$i++;
		}

		return $batch;
	}

	/**
	 * Load a single line into the batch
	 *
	 * @param string $line
	 * @param Batch $batch
	 * @param integer $lineNum
	 * @param array $nodes
	 * @param array $rels
	 */
	protected function loadLine($line, Batch $batch, $lineNum, &$nodes, &$rels)
	{
		$descriptorPattern = "/^(
			\((\w+)\)	            # node identifier or relationship start node
			(                       # next two sub expressions signify a relationship line
				-\[(\w*):(\w+)\]    # relationship identifier and type
				->\((\w+)\)         # relationship end node
		)?)(
			\s+(.*)                 # properties
		)?/x";

		$indexPattern = "/^(
			\{(\w+)\}               # index name
			->(\(|\[)				# ( indicates node index, [ indicates relationship index
				(\w+)               # node identifier to index
			(\)|\])                 # must match opening ( or [
		)(
			\s+(.*)                 # keys:values to index
		)?/x";

		$line = trim($line);
		if (!$line || $line[0]  == '#') {
			return;
		}

		$matches = array();
		$descriptorMatch = preg_match($descriptorPattern, $line, $matches);

		if ($descriptorMatch && !empty($matches[3])) {
			$startNodeId = $matches[2];
			$relId = $matches[4];
			$type = $matches[5];
			$endNodeId = $matches[6];
			if (!isset($nodes[$startNodeId]) || !isset($nodes[$endNodeId])) {
				throw new Exception("Invalid node reference on line {$lineNum}: $line");
			} else if (!empty($relId) && isset($rels[$relId])) {
				throw new Exception("Duplicate relationship on line {$lineNum}: $line");
			}
			$properties = !empty($matches[8]) ? json_decode($matches[8]) : false;
			$rel = $this->client->makeRelationship();
			$rel->setProperties($properties ?: array())
				->setType($type)
				->setStartNode($nodes[$startNodeId])
				->setEndNode($nodes[$endNodeId]);
			if (!empty($relId)) {
				$rels[$relId] = $rel;
			}
			$batch->save($rel);
			return;

		} else if ($descriptorMatch) {
			$nodeId = $matches[2];
			if (isset($nodes[$nodeId])) {
				throw new Exception("Duplicate node on line {$lineNum}: $line");
			}
			$properties = !empty($matches[7]) ? json_decode($matches[7]) : false;
			$node = $this->client->makeNode();
			$node->setProperties($properties ?: array());
			$nodes[$nodeId] = $node;
			$batch->save($node);
			return;
		}

		$matches = array();
		$indexMatch = preg_match($indexPattern, $line, $matches);
		if ($indexMatch) {
			$name = $matches[2];
			$openBrace = $matches[3];
			$closeBrace = $matches[5];
			$entityId = $matches[4];
			$properties = !empty($matches[7]) ? json_decode($matches[7]) : false;
			if ($properties) {
				$type = null;
				if ($openBrace == '(' && $closeBrace == ')') {
					if (!isset($nodes[$entityId])) {
						throw new Exception("Invalid node reference on line {$lineNum}: $line");
					}
					$entity = $nodes[$entityId];
					$type = Index::TypeNode;
				} else if ($openBrace == '[' && $closeBrace == ']') {
					if (!isset($rels[$entityId])) {
						throw new Exception("Invalid relationship reference on line {$lineNum}: $line");
					}
					$entity = $rels[$entityId];
					$type = Index::TypeRelationship;
				}

				if ($type) {
					$index = new Index($this->client, $type, $name);
					foreach ($properties as $key => $value) {
						$batch->addToIndex($index, $entity, $key, $value);
					}
					return;
				}
			}
		}

		throw new Exception("Cannot parse line {$lineNum}: $line");
	}
}


================================================
FILE: lib/Everyman/Neo4j/Geoff.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Implementation of GEOFF - Graph Export Object File Format
 * From http://py2neo.org/geoff
 * Available at http://github.com/nigelsmall/py2neo
 */
class Geoff
{
	protected $client = null;

	/**
	 * Build the importer/exported
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	/**
	 * Dump path information to a GEOFF string or file
	 *
	 * @param mixed $paths a single Path object or an array of Path objects
	 * @param stream $handle
	 * @return mixed stream or string
	 */
	public function dump($paths, $handle=null)
	{
		$returnString = false;
		if (!$handle) {
			$returnString = true;
			$handle = fopen('data:text/plain,', 'w+');
		}

		$exporter = new Geoff\Exporter();
		$exporter->dump($paths, $handle);

		if ($returnString) {
			return stream_get_contents($handle, -1, 0);
		}
		return $handle;
	}

	/**
	 * Load a GEOFF string or file
	 *
	 * @param mixed $handle
	 * @param Batch $batch
	 * @return Batch
	 */
	public function load($handle, Batch $batch=null)
	{
		if (is_string($handle)) {
			$handle = fopen('data:text/plain,'.urlencode($handle), 'r');
		}

		$importer = new Geoff\Importer($this->client);
		return $importer->load($handle, $batch);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Gremlin/Query.php
================================================
<?php
namespace Everyman\Neo4j\Gremlin;

use Everyman\Neo4j;

/**
 * Represents a Gremlin query
 * Query the database using Gremlin syntax. For query syntax, please refer
 * to the Gremlin documentation for your server version.
 *
 * Latest documentation:
 * http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html
 */
class Query implements Neo4j\Query
{
	protected $client = null;
	protected $script = null;
	protected $vars = array();

	protected $result = null;

	/**
	 * Set the query script to use
	 *
	 * @param Neo4j\Client $client
	 * @param string $script A Gremlin query script
	 * @param array $vars Replacement vars to inject into the query
	 */
	public function __construct(Neo4j\Client $client, $script, $vars=array())
	{
		$this->client = $client;
		$this->script = $script;
		$this->vars = $vars;
	}

	/**
	 * Get the query script
	 *
	 * @return string
	 */
	public function getQuery()
	{
		return $this->script;
	}

	/**
	 * Get the template parameters
	 *
	 * @return array
	 */
	public function getParameters()
	{
		return $this->vars;
	}

	/**
	 * Retrieve the query results
	 *
	 * @return Neo4j\Query\ResultSet
	 */
	public function getResultSet()
	{
		if ($this->result === null) {
			$this->result = $this->client->executeGremlinQuery($this);
		}

		return $this->result;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Index/NodeFulltextIndex.php
================================================
<?php
namespace Everyman\Neo4j\Index;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index\NodeIndex;

/**
 * Represents a fulltext node index in the database
 */
class NodeFulltextIndex extends NodeIndex
{
	/**
	 * Initialize the index
	 *
	 * @param Client $client
	 * @param string $name
	 * @param array  $config
	 */
	public function __construct(Client $client, $name, $config=array())
	{
		if (empty($config['type'])) {
			$config['type'] = 'fulltext';
		}
		if (empty($config['provider'])) {
			$config['provider'] = 'lucene';
		}

		parent::__construct($client, $name, $config);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Index/NodeIndex.php
================================================
<?php
namespace Everyman\Neo4j\Index;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index;

/**
 * Represents a node index in the database
 */
class NodeIndex extends Index
{
	/**
	 * Initialize the index
	 *
	 * @param Client $client
	 * @param string $name
	 * @param array  $config
	 */
	public function __construct(Client $client, $name, $config=array())
	{
		parent::__construct($client, Index::TypeNode, $name, $config);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Index/RelationshipIndex.php
================================================
<?php
namespace Everyman\Neo4j\Index;

use Everyman\Neo4j\Client,
	Everyman\Neo4j\Index;

/**
 * Represents a relationship index in the database
 */
class RelationshipIndex extends Index
{
	/**
	 * Initialize the index
	 *
	 * @param Client $client
	 * @param string $name
	 * @param array  $config
	 */
	public function __construct(Client $client, $name, $config=array())
	{
		parent::__construct($client, Index::TypeRelationship, $name, $config);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Index.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents an index in the database
 */
class Index
{
	const TypeNode = 'node';
	const TypeRelationship = 'relationship';

	protected $client = null;
	protected $type = self::TypeNode;
	protected $name = null;
	protected $config = array();

	/**
	 * Initialize the index
	 *
	 * @param Client $client
	 * @param string $type
	 * @param string $name
	 * @param array  $config
	 */
	public function __construct(Client $client, $type, $name, $config=array())
	{
		$this->client = $client;
		$this->type = $type;
		$this->name = $name;
		$this->config = $config;
	}

	/**
	 * Add an entity to the index
	 *
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return boolean
	 */
	public function add($entity, $key, $value)
	{
		return $this->client->addToIndex($this, $entity, $key, $value);
	}

	/**
	 * Delete this index
	 *
	 * @return boolean
	 */
	public function delete()
	{
		return $this->client->deleteIndex($this);
	}

	/**
	 * Find entities
	 *
	 * @param string $key
	 * @param string $value
	 * @return array
	 */
	public function find($key, $value)
	{
		return $this->client->searchIndex($this, $key, $value);
	}

	/**
	 * Find a single entity
	 *
	 * @param string $key
	 * @param string $value
	 * @return PropertyContainer
	 */
	public function findOne($key, $value)
	{
		$entities = $this->client->searchIndex($this, $key, $value);
		return $entities ? $entities[0] : null;
	}

	/**
	 * Get the configuration options for this index
	 *
	 * Configuration options are only used during index creation,
	 * see `save`
	 *
	 * @return array
	 */
	public function getConfig()
	{
		return $this->config;
	}

	/**
	 * Get the index name
	 *
	 * @return string
	 */
	public function getName()
	{
		return $this->name;
	}

	/**
	 * Get the index type
	 *
	 * @return string
	 */
	public function getType()
	{
		return $this->type;
	}

	/**
	 * Query index to find entities
	 *
	 * @param string $query
	 * @return array
	 */
	public function query($query)
	{
		return $this->client->queryIndex($this, $query);
	}

	/**
	 * Query index to find a single entity
	 *
	 * @param string $query
	 * @return PropertyContainer
	 */
	public function queryOne($query)
	{
		$entities = $this->client->queryIndex($this, $query);
		return $entities ? $entities[0] : null;
	}

	/**
	 * Remove an entity from the index
	 * If $value is not given, all reference of the entity for the key
	 * are removed.
	 * If $key is not given, all reference of the entity are removed.
	 *
	 * @param PropertyContainer $entity
	 * @param string $key
	 * @param string $value
	 * @return boolean
	 */
	public function remove($entity, $key=null, $value=null)
	{
		return $this->client->removeFromIndex($this, $entity, $key, $value);
	}

	/**
	 * Save this index
	 *
	 * @return boolean
	 */
	public function save()
	{
		return $this->client->saveIndex($this);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Label.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents a single label
 *
 * Labels cannot be saved standalone; instead, they are
 * saved when attached to a node
 */
class Label
{
	/**
	 * @var Client Our client
	 */
	protected $client;
	/**
	 * @var string Our name
	 */
	protected $name;

	/**
	 * Build the label and set its client and name
	 *
	 * @param Client $client
	 * @param string $name
	 * @throws \InvalidArgumentException
	 */
	public function __construct(Client $client, $name)
	{
		if (empty($name) || !(is_string($name) || is_numeric($name))) {
			throw new \InvalidArgumentException("Label name must be a string or number");
		}

		$this->setClient($client);
		$this->name = (string)$name;
	}

	/**
	 * Set the client to use with this Label object
	 *
	 * @param Client $client
	 * @return Label
	 */
	public function setClient(Client $client)
	{
		$this->client = $client;
		return $this;
	}

	/**
	 * Get our client
	 *
	 * @return Client
	 */
	public function getClient()
	{
		return $this->client;
	}

	/**
	 * Return the label name
	 *
	 * @return string
	 */
	public function getName()
	{
		return $this->name;
	}

	/**
	 * Get the nodes with this label
	 *
	 * If a property and value are given, only return
	 * nodes where the given property equals the value
	 *
	 * @param string $propertyName
	 * @param mixed  $propertyValue
	 * @return Query\Row
	 * @throws Exception on failure
	 */
	public function getNodes($propertyName=null, $propertyValue=null)
	{
		return $this->client->getNodesForLabel($this, $propertyName, $propertyValue);
	}

	/**
	 * Only serialize our name property
	 *
	 * @return array
	 */
	public function __sleep()
	{
		return array('name');
	}
}


================================================
FILE: lib/Everyman/Neo4j/Node.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents a single node in the database
 */
class Node extends PropertyContainer
{
	/**
	 * @var Label[] Our labels, or `null` if not loaded
	 */
	protected $labels = null;


	/**
	 * @inheritdoc
	 * @param Client $client
	 * @return Node
	 */
	public function setClient(Client $client)
	{
		parent::setClient($client);
		// set the client of each label in case it's not set yet
		if ($this->labels) {
			foreach ($this->labels as $label) {
				if (!$label->getClient()) {
					$label->setClient($client);
				}
			}
		}
		return $this;
	}

	/**
	 * Add labels to this node
	 *
	 * @param array $labels
	 * @return array of all the Labels on this node, including those just added
	 */
	public function addLabels($labels)
	{
		$this->labels = $this->client->addLabels($this, $labels);
		return $this->labels;
	}

	/**
	 * Delete this node
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	public function delete()
	{
		$this->client->deleteNode($this);
		return $this;
	}

	/**
	 * Find paths from this node to the given node
	 *
	 * @param Node $to
	 * @param string $type
	 * @param string $dir
	 * @return PathFinder
	 */
	public function findPathsTo(Node $to, $type=null, $dir=null)
	{
		$finder = new PathFinder($this->client);
		$finder->setStartNode($this);
		$finder->setEndNode($to);
		if ($dir) {
			$finder->setDirection($dir);
		}

		if ($type) {
			$finder->setType($type);
		}

		return $finder;
	}

	/**
	 * Get the first relationship of this node that matches the given criteria
	 *
	 * @param mixed  $types string or array of strings
	 * @param string $dir
	 * @return Relationship
	 */
	public function getFirstRelationship($types=array(), $dir=null)
	{
		$rels = $this->client->getNodeRelationships($this, $types, $dir);
		if (count($rels) < 1) {
			return null;
		}
		return $rels[0];
	}

	/**
	 * Get relationships of this node
	 *
	 * @param mixed  $types string or array of strings
	 * @param string $dir
	 * @return array of Relationship
	 */
	public function getRelationships($types=array(), $dir=null)
	{
		return $this->client->getNodeRelationships($this, $types, $dir);
	}

	/**
	 * List labels for this node
	 *
	 * @return array
	 * @throws Exception on failure
	 */
	public function getLabels()
	{
		if (is_null($this->labels)) {
			$this->labels = $this->client->getLabels($this);
		}
		return $this->labels;
	}

	/**
	 * Load this node
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	public function load()
	{
		$this->client->loadNode($this);
		return $this;
	}

	/**
	 * Make a new relationship
	 *
	 * @param Node $to
	 * @param string $type
	 * @return Relationship
	 */
	public function relateTo(Node $to, $type)
	{
		$rel = $this->client->makeRelationship();
		$rel->setStartNode($this);
		$rel->setEndNode($to);
		$rel->setType($type);

		return $rel;
	}

	/**
	 * Remove labels from this node
	 *
	 * @param array $labels
	 * @return array of all the Labels on this node, after removing the given labels
	 */
	public function removeLabels($labels)
	{
		$this->labels = $this->client->removeLabels($this, $labels);
		return $this->labels;
	}

	/**
	 * Save this node
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	public function save()
	{
		$this->client->saveNode($this);
		$this->useLazyLoad(false);
		return $this;
	}

	/**
	 * Be sure to add our properties to the things to serialize
	 *
	 * @return array
	 */
	public function __sleep()
	{
		return array_merge(parent::__sleep(), array('labels'));
	}
}


================================================
FILE: lib/Everyman/Neo4j/Pager.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Holds the parameters for running a paged traversal
 */
class Pager
{
	protected $traversal = null;
	protected $startNode = null;
	protected $returnType = null;

	protected $id = null;
	protected $leaseTime = null;
	protected $pageSize = null;

	/**
	 * Set the traversal to paginate
	 *
	 * @param Traversal $traversal
	 * @param Node $startNode
	 * @param string $returnType
	 */
	public function __construct(Traversal $traversal, Node $startNode, $returnType)
	{
		$this->traversal = $traversal;
		$this->startNode = $startNode;
		$this->returnType = $returnType;
	}

	/**
	 * Get the paged traversal id
	 *
	 * @return string
	 */
	public function getId()
	{
		return $this->id;
	}

	/**
	 * Get the lease time, in secods
	 *
	 * @return integer
	 */
	public function getLeaseTime()
	{
		return $this->leaseTime;
	}

	/**
	 * Get the next page of results
	 * If the traversal hasn't been run yet, this will run it
	 *
	 * @return array
	 */
	public function getNextResults()
	{
		return $this->traversal->getClient()->executePagedTraversal($this);
	}

	/**
	 * Get the maximum result page set size
	 *
	 * @return integer
	 */
	public function getPageSize()
	{
		return $this->pageSize;
	}

	/**
	 * Get the return type
	 *
	 * @return string
	 */
	public function getReturnType()
	{
		return $this->returnType;
	}

	/**
	 * Return the start node of the traversal
	 *
	 * @return Node
	 */
	public function getStartNode()
	{
		return $this->startNode;
	}

	/**
	 * Get the traversal being paginated
	 *
	 * @return Traversal
	 */
	public function getTraversal()
	{
		return $this->traversal;
	}

	/**
	 * Set the paged traversal id
	 *
	 * @param string $id
	 * @return Traversal
	 */
	public function setId($id)
	{
		$this->id = $id;
		return $this;
	}

	/**
	 * Set the lease time
	 *
	 * @param integer $leaseTime
	 * @return Traversal
	 */
	public function setLeaseTime($leaseTime)
	{
		$this->leaseTime = $leaseTime;
		return $this;
	}

	/**
	 * Set the page size
	 *
	 * @param integer $pageSize
	 * @return Traversal
	 */
	public function setPageSize($pageSize)
	{
		$this->pageSize = $pageSize;
		return $this;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Path.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents collection of relationships joining two nodes
 */
class Path implements \Countable, \IteratorAggregate
{
	const ContextNode = 'node';
	const ContextRelationship = 'relationship';

	protected $relationships = array();
	protected $nodes = array();
	protected $context = self::ContextNode;

	/**
	 * Add another node to the end of this path
	 *
	 * @param Node $node
	 * @return Path
	 */
	public function appendNode(Node $node)
	{
		$this->nodes[] = $node;
	}

	/**
	 * Add another relationship to the end of this path
	 *
	 * @param Relationship $rel
	 * @return Path
	 */
	public function appendRelationship(Relationship $rel)
	{
		$this->relationships[] = $rel;
	}

	/**
	 * Get the number of relationships in this path
	 *
	 * @return integer
	 */
	public function count()
	{
		return $this->context == self::ContextNode ? count($this->nodes) : count($this->relationships);
	}

	/**
	 * Get the current context for iteration
	 *
	 * @return string
	 */
	public function getContext()
	{
		return $this->context;
	}

	/**
	 * Get the end node
	 *
	 * @return Node
	 */
	public function getEndNode()
	{
		$length = count($this->nodes);
		if ($length) {
			return $this->nodes[$length-1];
		}
		return null;
	}

	/**
	 * Get the number of relationships in this path
	 *
	 * @return integer
	 */
	public function getLength()
	{
		return $this->count();
	}

	/**
	 * Return an iterator for iterating through the path
	 *
	 * @return Iterator
	 */
	public function getIterator()
	{
		return $this->context == self::ContextNode
			? new \ArrayIterator($this->nodes)
				: new \ArrayIterator($this->relationships);
	}

	/**
	 * Get the list of nodes that make up this path
	 *
	 * @return array
	 */
	public function getNodes()
	{
		return $this->nodes;
	}

	/**
	 * Get the list of relationships that make up this path
	 *
	 * @return array
	 */
	public function getRelationships()
	{
		return $this->relationships;
	}

	/**
	 * Get the start node
	 *
	 * @return Node
	 */
	public function getStartNode()
	{
		$length = count($this->nodes);
		if ($length) {
			return $this->nodes[0];
		}
		return null;
	}

	/**
	 * Set the context for iteration
	 *
	 * @param string $context
	 * @return Path
	 */
	public function setContext($context)
	{
		if ($context != self::ContextNode && $context != self::ContextRelationship) {
			$context = self::ContextNode;
		}
		$this->context = $context;
		return $this;
	}
}


================================================
FILE: lib/Everyman/Neo4j/PathFinder.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Holds the parameters for finding a path between two nodes
 */
class PathFinder
{
	const AlgoShortest  = 'shortestPath';
	const AlgoAll       = 'allPaths';
	const AlgoAllSimple = 'allSimplePaths';
	const AlgoDijkstra  = 'dijkstra';

	protected $client = null;

	protected $start = null;
	protected $end = null;
	protected $type = null;
	protected $maxDepth = null;
	protected $dir = null;
	protected $algo = self::AlgoShortest;
	protected $costProperty = null;
	protected $defaultCost = null;

	/**
	 * Build the finder and set its client
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	/**
	 * Get the current path finding algorithm
	 *
	 * @return string
	 */
	public function getAlgorithm()
	{
		return $this->algo;
	}

	/**
	 * Get the finder's client
	 *
	 * @return Client
	 */
	public function getClient()
	{
		return $this->client;
	}

	/**
	 * Get the cost property name for the Dijkstra search
	 *
	 * @return string
	 */
	public function getCostProperty()
	{
		return $this->costProperty;
	}

	/**
	 * Get the default relationship cost for the Dijkstra search
	 *
	 * @return numeric
	 */
	public function getDefaultCost()
	{
		return $this->defaultCost;
	}

	/**
	 * Get the path direction type
	 *
	 * @return string
	 */
	public function getDirection()
	{
		return $this->dir;
	}

	/**
	 * Get the end node
	 *
	 * @return Node
	 */
	public function getEndNode()
	{
		return $this->end;
	}

	/**
	 * Get the maximum allowed path length
	 *
	 * @return integer
	 */
	public function getMaxDepth()
	{
		return $this->maxDepth;
	}

	/**
	 * Find paths
	 *
	 * @return array of Path
	 */
	public function getPaths()
	{
		return $this->client->getPaths($this);
	}

	/**
	 * Get a single path
	 *
	 * @return Path
	 */
	public function getSinglePath()
	{
		$paths = $this->getPaths();
		return $paths ? $paths[0] : null;
	}

	/**
	 * Get the start node
	 *
	 * @return Node
	 */
	public function getStartNode()
	{
		return $this->start;
	}

	/**
	 * Get the relationship type
	 *
	 * @return string
	 */
	public function getType()
	{
		return $this->type;
	}

	/**
	 * Set the algorithm to use
	 *
	 * @param string $algo
	 * @return PathFinder
	 */
	public function setAlgorithm($algo)
	{
		$this->algo = $algo;
		return $this;
	}

	/**
	 * Set the cost property name for the Dijkstra search
	 *
	 * @param string $property
	 * @return PathFinder
	 */
	public function setCostProperty($property)
	{
		$this->costProperty = $property;
		return $this;
	}

	/**
	 * Set the default relationship cost for the Dijkstra search
	 *
	 * @param numeric $cost
	 * @return PathFinder
	 */
	public function setDefaultCost($cost)
	{
		$this->defaultCost = $cost;
		return $this;
	}

	/**
	 * Set the direction of the path
	 *
	 * @param string $dir
	 * @return PathFinder
	 */
	public function setDirection($dir)
	{
		$this->dir = $dir;
		return $this;
	}

	/**
	 * Set the end node
	 *
	 * @param Node $end
	 * @return PathFinder
	 */
	public function setEndNode(Node $end)
	{
		$this->end = $end;
		return $this;
	}

	/**
	 * Set the maximum allowed path length
	 *
	 * @param integer $max
	 * @return PathFinder
	 */
	public function setMaxDepth($max)
	{
		$this->maxDepth = $max;
		return $this;
	}

	/**
	 * Set the start node
	 *
	 * @param Node $start
	 * @return PathFinder
	 */
	public function setStartNode(Node $start)
	{
		$this->start = $start;
		return $this;
	}

	/**
	 * Set the type
	 *
	 * @param string $type
	 * @return PathFinder
	 */
	public function setType($type)
	{
		$this->type = $type;
		return $this;
	}
}


================================================
FILE: lib/Everyman/Neo4j/PropertyContainer.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents an entity that is a collection of properties
 */
abstract class PropertyContainer
{
	/**
	 * @var int our ID
	 */
	protected $id = null;
	/**
	 * @var Client Our client
	 */
	protected $client = null;
	/**
	 * @var array Our properties
	 */
	protected $properties = array();

	/**
	 * @var bool Are we in lazy load mode?
	 */
	protected $lazyLoad = true;
	/**
	 * @var bool Are we loaded?
	 */
	protected $loaded = false;

	/**
	 * Build the container and set its client
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->setClient($client);
	}

	public function __get($key)
	{
		return $this->getProperty($key);
	}

	public function __set($key, $value)
	{
		$this->setProperty($key, $value);
	}

	public function __unset($key)
	{
		$this->removeProperty($key);
	}

	public function __isset($key)
	{
		return array_key_exists($key, $this->properties);
	}

	public function __sleep()
	{
		return array('id', 'properties', 'lazyLoad', 'loaded');
	}

	/**
	 * Delete this entity
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	abstract public function delete();

	/**
	 * Load this entity
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	abstract public function load();

	/**
	 * Save this entity
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	abstract public function save();

	/**
	 * Get the entity's client
	 *
	 * @return Client
	 */
	public function getClient()
	{
		return $this->client;
	}

	/**
	 * Get the entity's id
	 *
	 * @return integer
	 */
	public function getId()
	{
		return $this->id;
	}

	/**
	 * Return all properties
	 *
	 * @return array
	 */
	public function getProperties()
	{
		$this->loadProperties();
		return $this->properties;
	}

	/**
	 * Return the named property
	 *
	 * @param string $property
	 * @return mixed
	 */
	public function getProperty($property)
	{
		$this->loadProperties();
		return (isset($this->properties[$property])) ? $this->properties[$property] : null;
	}

	/**
	 * Is this entity identified?
	 *
	 * @return boolean
	 */
	public function hasId()
	{
		return $this->getId() !== null;
	}

	/**
	 * Remove a property set on the entity
	 *
	 * @param string $property
	 * @return PropertyContainer
	 */
	public function removeProperty($property)
	{
		$this->loadProperties();
		unset($this->properties[$property]);
		return $this;
	}

	/**
	 * Set the entity's client
	 *
	 * @param Client $client
	 * @return PropertyContainer
	 */
	public function setClient(Client $client)
	{
		$this->client = $client;
		return $this;
	}

	/**
	 * Set the entity's id
	 *
	 * @param integer $id
	 * @return PropertyContainer
	 */
	public function setId($id)
	{
		$this->id = $id === null ? null : (int)$id;
		return $this;
	}

	/**
	 * Set multiple properties on the entity
	 *
	 * @param array $properties
	 * @return PropertyContainer
	 */
	public function setProperties($properties)
	{
		$this->loadProperties();
		foreach ($properties as $property => $value) {
			$this->setProperty($property, $value);
		}
		return $this;
	}

	/**
	 * Set a property on the entity
	 *
	 * @param string $property
	 * @param mixed $value
	 * @return PropertyContainer
	 */
	public function setProperty($property, $value)
	{
		$this->loadProperties();
		if ($value === null) {
			$this->removeProperty($property);
		} else {
			$this->properties[$property] = $value;
		}
		return $this;
	}

	/**
	 * Should this entity be lazy-loaded if necessary?
	 *
	 * @param boolean $lazyLoad
	 * @return PropertyContainer
	 */
	public function useLazyLoad($lazyLoad)
	{
		$this->lazyLoad = (bool)$lazyLoad;
		return $this;
	}

	/**
	 * Set up the properties array the first time we need it
	 *
	 * This includes loading the properties from the server
	 * if we can get them.
	 */
	protected function loadProperties()
	{
		if ($this->hasId() && $this->lazyLoad && !$this->loaded) {
			$this->loaded = true;
			$this->load();
		}
	}
}


================================================
FILE: lib/Everyman/Neo4j/Query/ResultSet.php
================================================
<?php
namespace Everyman\Neo4j\Query;

use Everyman\Neo4j\Client;

/**
 * This is what you get when you execute a query. Looping
 * over this will give you {@link Row} instances.
 */
class ResultSet implements \Iterator, \Countable, \ArrayAccess
{
	protected $client = null;

	protected $rows = array();
	protected $data = array();
	protected $columns = array();
	protected $position = 0;

	/**
	 * Set the array of results to represent
	 *
	 * @param Client $client
	 * @param array $result
	 */
	public function __construct(Client $client, $result)
	{
		$this->client = $client;
		if (is_array($result) && array_key_exists('data', $result)) {
			$this->data = $result['data'];
			$this->columns = $result['columns'];
		}
	}

	/**
	 * Return the list of column names
	 *
	 * @return array
	 */
	public function getColumns()
	{
		return $this->columns;
	}

	// ArrayAccess API

	public function offsetExists($offset)
	{
		return isset($this->data[$offset]);
	}

	public function offsetGet($offset)
	{
		if (!isset($this->rows[$offset])) {
			$this->rows[$offset] = new Row($this->client, $this->columns, $this->data[$offset]);
		}
		return $this->rows[$offset];
	}

	public function offsetSet($offset, $value)
	{
		throw new \BadMethodCallException("You cannot modify a query result.");
	}

	public function offsetUnset($offset)
	{
		throw new \BadMethodCallException("You cannot modify a query result.");
	}


	// Countable API

	public function count()
	{
		return count($this->data);
	}


	// Iterator API

	public function rewind()
	{
		$this->position = 0;
	}

	public function current()
	{
		return $this[$this->position];
	}

	public function key()
	{
		return $this->position;
	}

	public function next()
	{
		++$this->position;
	}

	public function valid()
	{
		return isset($this->data[$this->position]);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Query/Row.php
================================================
<?php
namespace Everyman\Neo4j\Query;

use Everyman\Neo4j\Client;

/**
 * Represents a single result row from a query.
 * You can loop over this to get each value, or you can
 * use array access ($myRow['columnName'] or $myRow[0])
 * to get specific fields.
 */
class Row implements \Iterator, \Countable, \ArrayAccess
{
	protected $client = null;
	protected $raw = null;
	protected $data = null;
	protected $columns = null;
	protected $position = 0;

	/**
	 * Set the raw result data of this row
	 *
	 * @param Client $client
	 * @param array $columns
	 * @param array $rowData
	 */
	public function __construct(Client $client, $columns, $rowData)
	{
		$this->client = $client;
		$this->raw = $rowData;
		$this->data = array();
		$this->columns = $columns;
	}

	// ArrayAccess API

	public function offsetExists($offset)
	{
		if (!is_integer($offset)) {

			$rawOffset = array_search($offset, $this->columns);

			if ($rawOffset === false) {
				return false;
			}

			return isset($this->raw[$rawOffset]);
		}

		return isset($this->raw[$offset]);
	}

	public function offsetGet($offset)
	{
		if (!is_integer($offset)) {
			$offset = array_search($offset, $this->columns);
		}

		if (!isset($this->data[$offset])) {
			$raw = $this->raw[$offset];
			$data = $this->client->getEntityMapper()->getEntityFor($raw);
			if (is_array($data)) {
				$data = new Row($this->client, array_keys($raw), array_values($raw));
			}
			$this->data[$offset] = $data;
		}

		return $this->data[$offset];
	}

	public function offsetSet($offset, $value)
	{
		throw new \BadMethodCallException("You cannot modify a result row.");
	}

	public function offsetUnset($offset)
	{
		throw new \BadMethodCallException("You cannot modify a result row.");
	}


	// Countable API

	public function count()
	{
		return count($this->raw);
	}


	// Iterator API

	public function rewind()
	{
		$this->position = 0;
	}

	public function current()
	{
		return $this[$this->position];
	}

	public function key()
	{
		return $this->columns[$this->position];
	}

	public function next()
	{
		++$this->position;
	}

	public function valid()
	{
		return $this->position < count($this->raw);
	}
}


================================================
FILE: lib/Everyman/Neo4j/Query.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents a query (e. g. Gremlin or Cypher)
 */
interface Query
{
	/**
	 * Get the query script
	 *
	 * @return string
	 */
	public function getQuery();

	/**
	 * Retrieve the query results
	 *
	 * @return Query\ResultSet
	 */
	public function getResultSet();
}


================================================
FILE: lib/Everyman/Neo4j/Relationship.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * Represents a relationship between two nodes
 */
class Relationship extends PropertyContainer
{
	const DirectionAll       = 'all';
	const DirectionIn        = 'in';
	const DirectionOut       = 'out';

	/**
	 * @var Node Our start node
	 */
	protected $start = null;
	/**
	 * @var Node Our end node
	 */
	protected $end = null;
	/**
	 * @var string Our type
	 */
	protected $type = null;


	/**
	 * @inheritdoc
	 * @param Client $client
	 * @return Relationship
	 */
	public function setClient(Client $client)
	{
		parent::setClient($client);
		// set the client of our start and end nodes if they exists and doesn't have client yet
		if ($this->start && !$this->start->getClient()) {
			$this->start->setClient($client);
		}
		if ($this->end && !$this->end->getClient()) {
			$this->end->setClient($client);
		}
		return $this;
	}

	/**
	 * Delete this relationship
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	public function delete()
	{
		$this->client->deleteRelationship($this);
		return $this;
	}

	/**
	 * Get the end node
	 *
	 * @return Node
	 */
	public function getEndNode()
	{
		if (null === $this->end) {
			$this->loadProperties();
		}
		return $this->end;
	}

	/**
	 * Get the start node
	 *
	 * @return Node
	 */
	public function getStartNode()
	{
		if (null === $this->start) {
			$this->loadProperties();
		}
		return $this->start;
	}

	/**
	 * Get the relationship type
	 *
	 * @return string
	 */
	public function getType()
	{
		$this->loadProperties();
		return $this->type;
	}

	/**
	 * Load this relationship
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	public function load()
	{
		$this->client->loadRelationship($this);
		return $this;
	}

	/**
	 * Save this node
	 *
	 * @return PropertyContainer
	 * @throws Exception on failure
	 */
	public function save()
	{
		$this->client->saveRelationship($this);
		$this->useLazyLoad(false);
		return $this;
	}

	/**
	 * Set the end node
	 *
	 * @param Node $end
	 * @return Relationship
	 */
	public function setEndNode(Node $end)
	{
		$this->end = $end;
		return $this;
	}

	/**
	 * Set the start node
	 *
	 * @param Node $start
	 * @return Relationship
	 */
	public function setStartNode(Node $start)
	{
		$this->start = $start;
		return $this;
	}

	/**
	 * Set the type
	 *
	 * @param string $type
	 * @return Relationship
	 */
	public function setType($type)
	{
		$this->type = $type;
		return $this;
	}


	/**
	 * Be sure to add our properties to the things to serialize
	 *
	 * @return array
	 */
	public function __sleep()
	{
		return array_merge(parent::__sleep(), array('start', 'end', 'type'));
	}
}


================================================
FILE: lib/Everyman/Neo4j/Transaction.php
================================================
<?php
namespace Everyman\Neo4j;

/**
 * A transaction context for multiple Cypher statements across multiple requests
 */
class Transaction
{
	protected $client;
	protected $id;
	protected $isClosed = false;
	protected $isError = false;

	/**
	 * Build the transaction and set its client
	 *
	 * @param Client $client
	 */
	public function __construct(Client $client)
	{
		$this->client = $client;
	}

	/**
	 * Add statements to this transaction
	 *
	 * @param mixed   $statements a single or list of Cypher\Query objects to add to the transaction
	 * @param boolean $commit should this transaction be committed with these statements?
	 * @return Query\ResultSet
	 */
	public function addStatements($statements, $commit=false)
	{
		$unwrap = false;
		if (!is_array($statements)) {
			$statements = array($statements);
			$unwrap = true;
		}

		$result = $this->performClientAction(function ($client, $transaction) use ($statements, $commit) {
			return $client->addStatementsToTransaction($transaction, $statements, $commit);
		}, $commit, false);

		if ($unwrap) {
			$result = reset($result);
		}

		return $result;
	}

	/**
	 * Commit this transaction immediately, without adding any new statements
	 *
	 * @return Transaction
	 */
	public function commit()
	{
		$this->performClientAction(function ($client, $transaction) {
			$client->addStatementsToTransaction($transaction, array(), true);
		}, true);
		return $this;
	}

	/**
	 * Return the transaction id
	 *
	 * @return integer
	 */
	public function getId()
	{
		return $this->id;
	}

	/**
	 * Has this transaction been closed?
	 *
	 * @return boolean
	 */
	public function isClosed()
	{
		return $this->isClosed;
	}

	/**
	 * Has this transaction experienced an error?
	 *
	 * @return boolean
	 */
	public function isError()
	{
		return $this->isError;
	}

	/**
	 * Ask for more time to keep this transaction open
	 *
	 * @return Transaction
	 */
	public function keepAlive()
	{
		$this->performClientAction(function ($client, $transaction) {
			$client->addStatementsToTransaction($transaction);
		}, false);
		return $this;
	}

	/**
	 * Rollback the transaction
	 *
	 * @return Transaction
	 */
	public function rollback()
	{
		$this->performClientAction(function ($client, $transaction) {
			$client->rollbackTransaction($transaction);
		}, true);
		return $this;
	}

	/**
	 * Set the transaction id
	 *
	 * Once an id has been set, the same id can be set again.
	 * Attempting to set a different id will throw an InvalidArgumentException.
	 *
	 * @param integer $id
	 * @return Transaction
	 * @throws InvalidArgumentException if an id is given that is different from the existing id
	 */
	public function setId($id)
	{
		if ($this->id && $this->id != $id) {
			throw new \InvalidArgumentException("Cannot set a new id on a transaction once an id has been set");
		}

		$this->id = $id;
		return $this;
	}

	/**
	 * Perform an action against the client
	 *
	 * @param callable $action
	 * @param boolean  $shouldClose
	 * @param boolean  $requireId
	 */
	protected function performClientAction($action, $shouldClose, $requireId=true)
	{
		if ($this->isClosed()) {
			throw new Exception('Transaction is already closed');
		}

		$result = null;
		if (!$requireId || $this->getId()) {
			try {
				$result = $action($this->client, $this);
			} catch (\Exception $e) {
				$this->isClosed = true;
				$this->isError = true;
				throw $e;
			}
		}

		$this->isClosed = $shouldClose;

		return $result;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Transport/Curl.php
================================================
<?php
namespace Everyman\Neo4j\Transport;

use Everyman\Neo4j\Transport as BaseTransport,
	Everyman\Neo4j\Version,
	Everyman\Neo4j\Exception;

/**
 * Class for communicating with an HTTP JSON endpoint
 */
class Curl extends BaseTransport
{
	protected $handle = null;

	/**
	 * @inherit
	 */
	public function __construct($host='localhost', $port=7474)
	{
		if (! function_exists('curl_init')) {
			throw new Exception('cUrl extension not enabled/installed');
		}

		parent::__construct($host, $port);
	}

	/**
	 * Make sure the curl handle closes when we are done with the Transport
	 */
	public function __destruct()
	{
		if ($this->handle) {
			curl_close($this->handle);
		}
	}

	/**
	 * @inherit
	 */
	public function makeRequest($method, $path, $data=array())
	{
		$url = $this->getEndpoint().$path;

		$options = array(
			CURLOPT_URL => $url,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_HEADER => true,
			CURLOPT_HTTPHEADER => array(
				'Accept: application/json;stream=true',
				'Content-type: application/json',
				'User-Agent: '.Version::userAgent(),
				'X-Stream: true'
			),
			CURLOPT_CUSTOMREQUEST => self::GET,
			CURLOPT_POST => false,
			CURLOPT_POSTFIELDS => null,
			CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
		);

		if ($this->username && $this->password) {
			$options[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
			$options[CURLOPT_USERPWD] = $this->username.':'.$this->password;
		}

		switch ($method) {
			case self::DELETE:
				$options[CURLOPT_CUSTOMREQUEST] = self::DELETE;
				break;

			case self::POST:
			case self::PUT:
				$dataString = $this->encodeData($data);
				$options[CURLOPT_CUSTOMREQUEST] = $method;
				$options[CURLOPT_POSTFIELDS] = $dataString;
				$options[CURLOPT_HTTPHEADER][] = 'Content-Length: '.strlen($dataString);

				if (self::POST == $method) {
					$options[CURLOPT_POST] = true;
				}
				break;
		}

		$ch = $this->getHandle();
		curl_setopt_array($ch, $options);

		$response = curl_exec($ch);
		$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
		$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);

		if ($response === false) {
			throw new Exception("Can't open connection to ".$url);
		}

		if (!$code) {
			$code = 500;
			$headerSize = 0;
			$response = json_encode(array("error"=>curl_error($ch).' ['.curl_errno($ch).']'));
		}

		$bodyString = substr($response, $headerSize);
		$bodyData = json_decode($bodyString, true);

		$headerString = substr($response, 0, $headerSize);
		$headers = explode("\r\n", $headerString);
		foreach ($headers as $i => $header) {
			unset($headers[$i]);
			$parts = explode(':', $header);
			if (isset($parts[1])) {
				$name = trim(array_shift($parts));
				$value = join(':', $parts);
				$headers[$name] = $value;
			}
		}

		return array(
			'code' => $code,
			'headers' => $headers,
			'data' => $bodyData,
		);
	}

	/**
	 * Get the cURL handle
	 *
	 * @return resource cURL handle
	 */
	protected function getHandle()
	{
		if (!$this->handle) {
			$this->handle = curl_init();
		}
		return $this->handle;
	}
}


================================================
FILE: lib/Everyman/Neo4j/Transport/Stream.php
================================================
<?php
namespace Everyman\Neo4j\Transport;

use Everyman\Neo4j\Transport as BaseTransport,
	Everyman\Neo4j\Version,
	Everyman\Neo4j\Exception;

/**
 * Class for communicating with an HTTP JSON endpoint over PHP streams
 */
class Stream extends BaseTransport
{
	/**
	 * @inherit
	 */
	public function makeRequest($method, $path, $data=array())
	{
		$url = $this->getEndpoint().$path;

		$context_options = array (
			$this->scheme => array (
				'method' => 'GET',
				'ignore_errors' => true,
				'header'=>
					"Content-type: application/json\r\n"
					. "Accept: application/json;stream=true\r\n"
					. "User-Agent: ".Version::userAgent()."\r\n"
					. "X-Stream: true\r\n"
			)
		);

		if ($this->username && $this->password) {
			$encodedAuth = base64_encode($this->username.':'.$this->password);
			$context_options[$this->scheme]['header'] .= 'Authorization: Basic ' . $encodedAuth . "\r\n";
		}

		switch ($method) {
			case self::DELETE:
				$context_options[$this->scheme]['method'] = self::DELETE;
				break;

			case self::POST:
			case self::PUT:
				$dataString = $this->encodeData($data);
				$context_options[$this->scheme]['method'] = $method;
				$context_options[$this->scheme]['content'] = $dataString;
				$context_options[$this->scheme]['header'] .= 'Context-Length: ' . strlen($dataString) . "\r\n";
				break;
		}

		$context = stream_context_create($context_options);
		$response = file_get_contents($url, false, $context);

		if ($response === false) {
			throw new Exception("Can't open connection to ".$url);
		}

		// $http_response_header is set by file_get_contents with the http:// wrapper

		preg_match('/^HTTP\/1\.[0-1] (\d{3})/', $http_response_header[0], $parts);
		$code = $parts[1];

		if (!$code) {
			$code = 500;
			$response = json_encode(array("error"=>'error [' . $code . ']'));
		}

		$bodyData = json_decode($response, true);

		$headers = array();
		foreach ($http_response_header as $header) {
			$parts = explode(':', $header, 2);

			if (count($parts) == 2) {
				$headers[$parts[0]] = $parts[1];
			}
		}

		return array(
			'code' => $code,
			'
Download .txt
gitextract_0kzioh7m/

├── .gitignore
├── .travis.yml
├── LICENSE
├── Neo4jPhpVersionTask.php
├── README.md
├── build.xml
├── composer.json
├── docblox.dist.xml
├── examples/
│   ├── bacon.php
│   ├── batch_benchmarks.php
│   ├── cypher.php
│   ├── directions.php
│   ├── example_bootstrap.php
│   ├── gremlin.php
│   ├── indexing.php
│   └── widgets.php
├── lib/
│   └── Everyman/
│       └── Neo4j/
│           ├── Batch/
│           │   ├── AddTo.php
│           │   ├── Delete.php
│           │   ├── Operation.php
│           │   ├── RemoveFrom.php
│           │   └── Save.php
│           ├── Batch.php
│           ├── Cache/
│           │   ├── EntityCache.php
│           │   ├── Memcache.php
│           │   ├── Memcached.php
│           │   ├── None.php
│           │   └── Variable.php
│           ├── Cache.php
│           ├── Client.php
│           ├── Command/
│           │   ├── AddLabels.php
│           │   ├── AddStatementsToTransaction.php
│           │   ├── AddToIndex.php
│           │   ├── Batch/
│           │   │   ├── AddToIndex.php
│           │   │   ├── Command.php
│           │   │   ├── Commit.php
│           │   │   ├── CreateNode.php
│           │   │   ├── CreateRelationship.php
│           │   │   ├── DeleteNode.php
│           │   │   ├── DeleteRelationship.php
│           │   │   ├── RemoveFromIndex.php
│           │   │   ├── UpdateNode.php
│           │   │   └── UpdateRelationship.php
│           │   ├── CreateNode.php
│           │   ├── CreateRelationship.php
│           │   ├── DeleteIndex.php
│           │   ├── DeleteNode.php
│           │   ├── DeleteRelationship.php
│           │   ├── ExecuteCypherQuery.php
│           │   ├── ExecuteGremlinQuery.php
│           │   ├── ExecutePagedTraversal.php
│           │   ├── ExecuteTraversal.php
│           │   ├── GetIndexes.php
│           │   ├── GetLabels.php
│           │   ├── GetNode.php
│           │   ├── GetNodeRelationships.php
│           │   ├── GetNodesForLabel.php
│           │   ├── GetPaths.php
│           │   ├── GetRelationship.php
│           │   ├── GetRelationshipTypes.php
│           │   ├── GetServerInfo.php
│           │   ├── QueryIndex.php
│           │   ├── RemoveFromIndex.php
│           │   ├── RemoveLabels.php
│           │   ├── RollbackTransaction.php
│           │   ├── SaveIndex.php
│           │   ├── SearchIndex.php
│           │   ├── SetLabels.php
│           │   ├── UpdateNode.php
│           │   └── UpdateRelationship.php
│           ├── Command.php
│           ├── Cypher/
│           │   └── Query.php
│           ├── EntityMapper.php
│           ├── Exception.php
│           ├── Geoff/
│           │   ├── Exporter.php
│           │   └── Importer.php
│           ├── Geoff.php
│           ├── Gremlin/
│           │   └── Query.php
│           ├── Index/
│           │   ├── NodeFulltextIndex.php
│           │   ├── NodeIndex.php
│           │   └── RelationshipIndex.php
│           ├── Index.php
│           ├── Label.php
│           ├── Node.php
│           ├── Pager.php
│           ├── Path.php
│           ├── PathFinder.php
│           ├── PropertyContainer.php
│           ├── Query/
│           │   ├── ResultSet.php
│           │   └── Row.php
│           ├── Query.php
│           ├── Relationship.php
│           ├── Transaction.php
│           ├── Transport/
│           │   ├── Curl.php
│           │   └── Stream.php
│           ├── Transport.php
│           ├── Traversal.php
│           └── Version.php
├── phpconfig.ini
├── stub.php
└── tests/
    ├── cs/
    │   └── ruleset.xml
    ├── phpunit.xml
    └── unit/
        └── lib/
            └── Everyman/
                └── Neo4j/
                    ├── BatchTest.php
                    ├── Cache/
                    │   ├── MemcacheTest.php
                    │   ├── MemcachedTest.php
                    │   ├── NoneTest.php
                    │   └── VariableTest.php
                    ├── ClientTest.php
                    ├── Client_Batch_IndexTest.php
                    ├── Client_Batch_NodeTest.php
                    ├── Client_Batch_RelationshipTest.php
                    ├── Client_CacheTest.php
                    ├── Client_CypherTest.php
                    ├── Client_GremlinTest.php
                    ├── Client_IndexTest.php
                    ├── Client_LabelTest.php
                    ├── Client_PathTest.php
                    ├── Client_TransactionTest.php
                    ├── Client_TraversalTest.php
                    ├── Cypher/
                    │   └── QueryTest.php
                    ├── EntityMapperTest.php
                    ├── GeoffTest.php
                    ├── Gremlin/
                    │   └── QueryTest.php
                    ├── IndexTest.php
                    ├── LabelTest.php
                    ├── NodeTest.php
                    ├── PagerTest.php
                    ├── PathFinderTest.php
                    ├── PathTest.php
                    ├── PropertyContainerTest.php
                    ├── Query/
                    │   ├── ResultSetTest.php
                    │   └── RowTest.php
                    ├── RelationshipTest.php
                    ├── TransactionTest.php
                    ├── TransportTest.php
                    └── TraversalTest.php
Download .txt
SYMBOL INDEX (1082 symbols across 117 files)

FILE: Neo4jPhpVersionTask.php
  class Neo4jPhpVersionTask (line 4) | class Neo4jPhpVersionTask extends Task
    method init (line 8) | public function init(){}
    method setProperty (line 10) | public function setProperty($name)
    method main (line 15) | public function main()

FILE: examples/batch_benchmarks.php
  class Benchmark (line 37) | abstract class Benchmark
    method batch (line 42) | abstract protected function batch($size);
    method sequential (line 43) | abstract protected function sequential($size);
    method __construct (line 45) | public function __construct(Client $client)
    method benchmark (line 50) | public function benchmark($series, $runs)
  class CreateNode (line 73) | class CreateNode extends Benchmark
    method batch (line 77) | protected function batch($size)
    method sequential (line 89) | protected function sequential($size)
  class CreateRelationship (line 100) | class CreateRelationship extends Benchmark
    method batch (line 104) | protected function batch($size)
    method sequential (line 119) | protected function sequential($size)
  class CreateFullRelationship (line 133) | class CreateFullRelationship extends Benchmark
    method batch (line 137) | protected function batch($size)
    method sequential (line 151) | protected function sequential($size)

FILE: lib/Everyman/Neo4j/Batch.php
  class Batch (line 7) | class Batch
    method __construct (line 20) | public function __construct(Client $client)
    method addToIndex (line 34) | public function addToIndex(Index $index, PropertyContainer $entity, $k...
    method commit (line 44) | public function commit()
    method delete (line 60) | public function delete(PropertyContainer $entity)
    method getClient (line 70) | public function getClient()
    method getOperations (line 80) | public function getOperations()
    method removeFromIndex (line 94) | public function removeFromIndex(Index $index, PropertyContainer $entit...
    method reserve (line 109) | public function reserve($opId)
    method save (line 123) | public function save(PropertyContainer $entity)
    method addOperation (line 134) | protected function addOperation(Batch\Operation $operation)
    method nextId (line 153) | protected function nextId()

FILE: lib/Everyman/Neo4j/Batch/AddTo.php
  class AddTo (line 12) | class AddTo extends Operation
    method __construct (line 29) | public function __construct(Batch $batch, Index $index, PropertyContai...
    method getCommand (line 42) | public function getCommand()
    method getIndex (line 63) | public function getIndex()
    method getKey (line 73) | public function getKey()
    method getValue (line 83) | public function getValue()
    method matchId (line 93) | public function matchId()

FILE: lib/Everyman/Neo4j/Batch/Delete.php
  class Delete (line 13) | class Delete extends Operation
    method __construct (line 24) | public function __construct(Batch $batch, PropertyContainer $entity, $...
    method getCommand (line 34) | public function getCommand()

FILE: lib/Everyman/Neo4j/Batch/Operation.php
  class Operation (line 10) | abstract class Operation
    method __construct (line 27) | public function __construct(Batch $batch, $operation, PropertyContaine...
    method getCommand (line 40) | abstract public function getCommand();
    method getEntity (line 47) | public function getEntity()
    method getId (line 57) | public function getId()
    method matchId (line 67) | public function matchId()
    method reserve (line 81) | public function reserve()

FILE: lib/Everyman/Neo4j/Batch/RemoveFrom.php
  class RemoveFrom (line 12) | class RemoveFrom extends Operation
    method __construct (line 29) | public function __construct(Batch $batch, Index $index, PropertyContai...
    method getCommand (line 42) | public function getCommand()
    method matchId (line 62) | public function matchId()

FILE: lib/Everyman/Neo4j/Batch/Save.php
  class Save (line 13) | class Save extends Operation
    method __construct (line 24) | public function __construct(Batch $batch, PropertyContainer $entity, $...
    method getCommand (line 34) | public function getCommand()

FILE: lib/Everyman/Neo4j/Cache.php
  type Cache (line 7) | interface Cache
    method delete (line 15) | public function delete($key);
    method get (line 25) | public function get($key);
    method set (line 42) | public function set($key, $value, $expire=0);

FILE: lib/Everyman/Neo4j/Cache/EntityCache.php
  class EntityCache (line 14) | class EntityCache
    method __construct (line 27) | public function __construct(Client $client, Cache $cache=null, $cacheT...
    method deleteCachedEntity (line 38) | public function deleteCachedEntity(PropertyContainer $entity)
    method getCachedEntity (line 49) | public function getCachedEntity($id, $type)
    method setCache (line 68) | public function setCache(Cache $cache=null, $cacheTimeout=null)
    method setCachedEntity (line 79) | public function setCachedEntity(PropertyContainer $entity)
    method getCache (line 89) | protected function getCache()
    method getEntityCacheKey (line 103) | protected function getEntityCacheKey(PropertyContainer $entity)

FILE: lib/Everyman/Neo4j/Cache/Memcache.php
  class Memcache (line 9) | class Memcache implements Cache
    method __construct (line 18) | public function __construct(\Memcache $memcache)
    method delete (line 29) | public function delete($key)
    method get (line 42) | public function get($key)
    method set (line 62) | public function set($key, $value, $expire=0)

FILE: lib/Everyman/Neo4j/Cache/Memcached.php
  class Memcached (line 9) | class Memcached implements Cache
    method __construct (line 18) | public function __construct(\Memcached $memcached)
    method delete (line 29) | public function delete($key)
    method get (line 42) | public function get($key)
    method set (line 62) | public function set($key, $value, $expire=0)

FILE: lib/Everyman/Neo4j/Cache/None.php
  class None (line 9) | class None implements Cache
    method delete (line 17) | public function delete($key)
    method get (line 28) | public function get($key)
    method set (line 41) | public function set($key, $value, $expire=0)

FILE: lib/Everyman/Neo4j/Cache/Variable.php
  class Variable (line 11) | class Variable implements Cache
    method delete (line 21) | public function delete($key)
    method get (line 35) | public function get($key)
    method set (line 64) | public function set($key, $value, $expire=0)
    method calculateExpiration (line 81) | protected function calculateExpiration($expire)

FILE: lib/Everyman/Neo4j/Client.php
  class Client (line 7) | class Client
    method __construct (line 43) | public function __construct($transport=null, $port=7474)
    method addLabels (line 78) | public function addLabels(Node $node, $labels)
    method addStatementsToTransaction (line 92) | public function addStatementsToTransaction(Transaction $transaction, $...
    method addToIndex (line 107) | public function addToIndex(Index $index, PropertyContainer $entity, $k...
    method beginTransaction (line 122) | public function beginTransaction()
    method commitBatch (line 134) | public function commitBatch(Batch $batch=null)
    method deleteIndex (line 160) | public function deleteIndex(Index $index)
    method deleteNode (line 171) | public function deleteNode(Node $node)
    method deleteRelationship (line 187) | public function deleteRelationship(Relationship $relationship)
    method endBatch (line 204) | public function endBatch()
    method executeCypherQuery (line 216) | public function executeCypherQuery(Cypher\Query $query)
    method executeGremlinQuery (line 228) | public function executeGremlinQuery(Gremlin\Query $query)
    method executePagedTraversal (line 240) | public function executePagedTraversal(Pager $pager)
    method executeTraversal (line 254) | public function executeTraversal(Traversal $traversal, Node $startNode...
    method getEntityCache (line 265) | public function getEntityCache()
    method getEntityMapper (line 278) | public function getEntityMapper()
    method getIndexes (line 292) | public function getIndexes($type)
    method getLabels (line 307) | public function getLabels(Node $node=null)
    method getNode (line 325) | public function getNode($id, $force=false)
    method getNodeRelationships (line 359) | public function getNodeRelationships(Node $node, $types=array(), $dir=...
    method getNodesForLabel (line 376) | public function getNodesForLabel(Label $label, $propertyName=null, $pr...
    method getPaths (line 388) | public function getPaths(PathFinder $finder)
    method getReferenceNode (line 399) | public function getReferenceNode()
    method getRelationship (line 416) | public function getRelationship($id, $force=false)
    method getRelationshipTypes (line 448) | public function getRelationshipTypes()
    method getServerInfo (line 460) | public function getServerInfo($force=false)
    method getTransport (line 474) | public function getTransport()
    method hasCapability (line 485) | public function hasCapability($capability)
    method loadNode (line 519) | public function loadNode(Node $node)
    method loadRelationship (line 536) | public function loadRelationship(Relationship $rel)
    method makeLabel (line 557) | public function makeLabel($name)
    method makeNode (line 575) | public function makeNode($properties=array())
    method makeRelationship (line 592) | public function makeRelationship($properties=array())
    method queryIndex (line 610) | public function queryIndex(Index $index, $query)
    method rollbackTransaction (line 622) | public function rollbackTransaction(Transaction $transaction)
    method removeFromIndex (line 640) | public function removeFromIndex(Index $index, PropertyContainer $entit...
    method removeLabels (line 658) | public function removeLabels(Node $node, $labels)
    method saveIndex (line 670) | public function saveIndex(Index $index)
    method saveNode (line 681) | public function saveNode(Node $node)
    method saveRelationship (line 701) | public function saveRelationship(Relationship $rel)
    method searchIndex (line 723) | public function searchIndex(Index $index, $key, $value)
    method setEntityCache (line 734) | public function setEntityCache(Cache\EntityCache $cache)
    method setEntityMapper (line 744) | public function setEntityMapper(EntityMapper $mapper)
    method setNodeFactory (line 761) | public function setNodeFactory($factory)
    method setRelationshipFactory (line 783) | public function setRelationshipFactory($factory)
    method setTransport (line 798) | public function setTransport(Transport $transport)
    method startBatch (line 812) | public function startBatch()
    method runCommand (line 826) | protected function runCommand(Command $command)

FILE: lib/Everyman/Neo4j/Command.php
  class Command (line 7) | abstract class Command
    method __construct (line 16) | public function __construct(Client $client)
    method getData (line 26) | abstract protected function getData();
    method getMethod (line 33) | abstract protected function getMethod();
    method getPath (line 40) | abstract protected function getPath();
    method handleResult (line 51) | abstract protected function handleResult($code, $headers, $data);
    method execute (line 59) | public function execute()
    method getEntityCache (line 79) | protected function getEntityCache()
    method getEntityMapper (line 89) | protected function getEntityMapper()
    method getTransport (line 99) | protected function getTransport()
    method throwException (line 113) | protected function throwException($message, $code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/AddLabels.php
  class AddLabels (line 12) | class AddLabels extends SetLabels
    method __construct (line 21) | public function __construct(Client $client, Node $node, $labels)

FILE: lib/Everyman/Neo4j/Command/AddStatementsToTransaction.php
  class AddStatementsToTransaction (line 14) | class AddStatementsToTransaction extends Command
    method __construct (line 28) | public function __construct(Client $client, Transaction $transaction, ...
    method getData (line 41) | protected function getData()
    method formatStatement (line 57) | protected function formatStatement(Query $statement)
    method getMethod (line 71) | protected function getMethod()
    method getPath (line 81) | protected function getPath()
    method handleResult (line 109) | protected function handleResult($code, $headers, $data)
    method mapResult (line 129) | protected function mapResult($result)
    method setTransactionId (line 146) | protected function setTransactionId($data)

FILE: lib/Everyman/Neo4j/Command/AddToIndex.php
  class AddToIndex (line 15) | class AddToIndex extends Command
    method __construct (line 31) | public function __construct(Client $client, Index $index, PropertyCont...
    method getData (line 45) | protected function getData()
    method getMethod (line 72) | protected function getMethod()
    method getPath (line 82) | protected function getPath()
    method handleResult (line 110) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/Batch/AddToIndex.php
  class AddToIndex (line 14) | class AddToIndex extends Command
    method __construct (line 30) | public function __construct(Client $client, Index $index, PropertyCont...
    method getData (line 42) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/Command.php
  class Command (line 10) | abstract class Command extends SingleCommand
    method __construct (line 22) | public function __construct(Client $client, SingleCommand $base, $opId)
    method getMethod (line 34) | protected function getMethod()
    method getPath (line 44) | protected function getPath()
    method handleResult (line 58) | protected function handleResult($code, $headers, $data)
    method handleSingleResult (line 77) | protected function handleSingleResult($result)

FILE: lib/Everyman/Neo4j/Command/Batch/Commit.php
  class Commit (line 12) | class Commit extends Command
    method __construct (line 22) | public function __construct(Client $client, Batch $batch)
    method getData (line 33) | protected function getData()
    method handleSingleResult (line 53) | protected function handleSingleResult($result)

FILE: lib/Everyman/Neo4j/Command/Batch/CreateNode.php
  class CreateNode (line 11) | class CreateNode extends Command
    method __construct (line 20) | public function __construct(Client $client, Node $node, $opId)
    method getData (line 30) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/CreateRelationship.php
  class CreateRelationship (line 13) | class CreateRelationship extends Command
    method __construct (line 26) | public function __construct(Client $client, Relationship $rel, $opId, ...
    method getData (line 38) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/DeleteNode.php
  class DeleteNode (line 11) | class DeleteNode extends Command
    method __construct (line 20) | public function __construct(Client $client, Node $node, $opId)
    method getData (line 30) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/DeleteRelationship.php
  class DeleteRelationship (line 11) | class DeleteRelationship extends Command
    method __construct (line 20) | public function __construct(Client $client, Relationship $rel, $opId)
    method getData (line 30) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/RemoveFromIndex.php
  class RemoveFromIndex (line 13) | class RemoveFromIndex extends Command
    method __construct (line 25) | public function __construct(Client $client, Index $index, PropertyCont...
    method getData (line 35) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/UpdateNode.php
  class UpdateNode (line 11) | class UpdateNode extends Command
    method __construct (line 20) | public function __construct(Client $client, Node $node, $opId)
    method getData (line 30) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/Batch/UpdateRelationship.php
  class UpdateRelationship (line 11) | class UpdateRelationship extends Command
    method __construct (line 20) | public function __construct(Client $client, Relationship $rel, $opId)
    method getData (line 30) | protected function getData()

FILE: lib/Everyman/Neo4j/Command/CreateNode.php
  class CreateNode (line 11) | class CreateNode extends Command
    method __construct (line 21) | public function __construct(Client $client, Node $node)
    method getData (line 32) | protected function getData()
    method getMethod (line 42) | protected function getMethod()
    method getPath (line 52) | protected function getPath()
    method handleResult (line 66) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/CreateRelationship.php
  class CreateRelationship (line 13) | class CreateRelationship extends Command
    method __construct (line 23) | public function __construct(Client $client, Relationship $rel)
    method getData (line 34) | protected function getData()
    method getMethod (line 63) | protected function getMethod()
    method getPath (line 73) | protected function getPath()
    method handleResult (line 91) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/DeleteIndex.php
  class DeleteIndex (line 12) | class DeleteIndex extends Command
    method __construct (line 22) | public function __construct(Client $client, Index $index)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 77) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/DeleteNode.php
  class DeleteNode (line 12) | class DeleteNode extends Command
    method __construct (line 22) | public function __construct(Client $client, Node $node)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 70) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/DeleteRelationship.php
  class DeleteRelationship (line 12) | class DeleteRelationship extends Command
    method __construct (line 22) | public function __construct(Client $client, Relationship $rel)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 70) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/ExecuteCypherQuery.php
  class ExecuteCypherQuery (line 14) | class ExecuteCypherQuery extends Command
    method __construct (line 24) | public function __construct(Client $client, Query $query)
    method getData (line 35) | protected function getData()
    method getMethod (line 50) | protected function getMethod()
    method getPath (line 60) | protected function getPath()
    method handleResult (line 78) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/ExecuteGremlinQuery.php
  class ExecuteGremlinQuery (line 14) | class ExecuteGremlinQuery extends Command
    method __construct (line 24) | public function __construct(Client $client, Query $query)
    method getData (line 35) | protected function getData()
    method getMethod (line 50) | protected function getMethod()
    method getPath (line 60) | protected function getPath()
    method handleResult (line 78) | protected function handleResult($code, $headers, $data)
    method normalizeData (line 94) | protected function normalizeData($data)

FILE: lib/Everyman/Neo4j/Command/ExecutePagedTraversal.php
  class ExecutePagedTraversal (line 10) | class ExecutePagedTraversal extends ExecuteTraversal
    method __construct (line 20) | public function __construct(Client $client, Pager $pager)
    method getData (line 31) | protected function getData()
    method getMethod (line 41) | protected function getMethod()
    method getPath (line 51) | protected function getPath()
    method handleResult (line 84) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/ExecuteTraversal.php
  class ExecuteTraversal (line 14) | class ExecuteTraversal extends Command
    method __construct (line 30) | public function __construct(Client $client, Traversal $traversal, Node...
    method getData (line 43) | protected function getData()
    method getMethod (line 93) | protected function getMethod()
    method getPath (line 103) | protected function getPath()
    method handleResult (line 127) | protected function handleResult($code, $headers, $data)
    method handleNodes (line 151) | protected function handleNodes($data)
    method handleRelationships (line 163) | protected function handleRelationships($data)
    method handlePaths (line 176) | protected function handlePaths($data, $full=false)

FILE: lib/Everyman/Neo4j/Command/GetIndexes.php
  class GetIndexes (line 12) | class GetIndexes extends Command
    method __construct (line 22) | public function __construct(Client $client, $type)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 71) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetLabels.php
  class GetLabels (line 11) | class GetLabels extends Command
    method __construct (line 21) | public function __construct(Client $client, Node $node=null)
    method getData (line 32) | protected function getData()
    method getMethod (line 42) | protected function getMethod()
    method getPath (line 52) | protected function getPath()
    method handleResult (line 79) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetNode.php
  class GetNode (line 12) | class GetNode extends Command
    method __construct (line 22) | public function __construct(Client $client, Node $node)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 70) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetNodeRelationships.php
  class GetNodeRelationships (line 13) | class GetNodeRelationships extends Command
    method __construct (line 27) | public function __construct(Client $client, Node $node, $types=array()...
    method getData (line 50) | protected function getData()
    method getMethod (line 60) | protected function getMethod()
    method getPath (line 70) | protected function getPath()
    method handleResult (line 93) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetNodesForLabel.php
  class GetNodesForLabel (line 12) | class GetNodesForLabel extends Command
    method __construct (line 26) | public function __construct(Client $client, Label $label, $propertyNam...
    method getData (line 40) | protected function getData()
    method getMethod (line 50) | protected function getMethod()
    method getPath (line 60) | protected function getPath()
    method handleResult (line 95) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetPaths.php
  class GetPaths (line 13) | class GetPaths extends Command
    method __construct (line 23) | public function __construct(Client $client, PathFinder $finder)
    method getData (line 35) | protected function getData()
    method getMethod (line 93) | protected function getMethod()
    method getPath (line 103) | protected function getPath()
    method handleResult (line 121) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetRelationship.php
  class GetRelationship (line 13) | class GetRelationship extends Command
    method __construct (line 23) | public function __construct(Client $client, Relationship $rel)
    method getData (line 34) | protected function getData()
    method getMethod (line 44) | protected function getMethod()
    method getPath (line 54) | protected function getPath()
    method handleResult (line 71) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetRelationshipTypes.php
  class GetRelationshipTypes (line 10) | class GetRelationshipTypes extends Command
    method getData (line 17) | protected function getData()
    method getMethod (line 27) | protected function getMethod()
    method getPath (line 37) | protected function getPath()
    method handleResult (line 50) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/GetServerInfo.php
  class GetServerInfo (line 10) | class GetServerInfo extends Command
    method getData (line 17) | protected function getData()
    method getMethod (line 27) | protected function getMethod()
    method getPath (line 37) | protected function getPath()
    method handleResult (line 50) | protected function handleResult($code, $headers, $data)
    method parseVersion (line 65) | protected function parseVersion($fullVersion)

FILE: lib/Everyman/Neo4j/Command/QueryIndex.php
  class QueryIndex (line 14) | class QueryIndex extends SearchIndex
    method __construct (line 23) | public function __construct(Client $client, Index $index, $query)
    method getPath (line 33) | protected function getPath()

FILE: lib/Everyman/Neo4j/Command/RemoveFromIndex.php
  class RemoveFromIndex (line 15) | class RemoveFromIndex extends Command
    method __construct (line 35) | public function __construct(Client $client, Index $index, PropertyCont...
    method getData (line 49) | protected function getData()
    method getMethod (line 59) | protected function getMethod()
    method getPath (line 69) | protected function getPath()
    method handleResult (line 113) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/RemoveLabels.php
  class RemoveLabels (line 12) | class RemoveLabels extends SetLabels
    method __construct (line 21) | public function __construct(Client $client, Node $node, $labels)

FILE: lib/Everyman/Neo4j/Command/RollbackTransaction.php
  class RollbackTransaction (line 12) | class RollbackTransaction extends Command
    method __construct (line 22) | public function __construct(Client $client, Transaction $transaction)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 77) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/SaveIndex.php
  class SaveIndex (line 12) | class SaveIndex extends Command
    method __construct (line 22) | public function __construct(Client $client, Index $index)
    method getData (line 33) | protected function getData()
    method getMethod (line 54) | protected function getMethod()
    method getPath (line 64) | protected function getPath()
    method handleResult (line 82) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/SearchIndex.php
  class SearchIndex (line 14) | class SearchIndex extends Command
    method __construct (line 28) | public function __construct(Client $client, Index $index, $key, $value)
    method getData (line 41) | protected function getData()
    method getMethod (line 51) | protected function getMethod()
    method getPath (line 61) | protected function getPath()
    method handleResult (line 93) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/SetLabels.php
  class SetLabels (line 16) | class SetLabels extends ExecuteCypherQuery
    method __construct (line 26) | public function __construct(Client $client, Node $node, $labels, $remo...
    method handleResult (line 66) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/UpdateNode.php
  class UpdateNode (line 12) | class UpdateNode extends Command
    method __construct (line 22) | public function __construct(Client $client, Node $node)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 70) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Command/UpdateRelationship.php
  class UpdateRelationship (line 12) | class UpdateRelationship extends Command
    method __construct (line 22) | public function __construct(Client $client, Relationship $rel)
    method getData (line 33) | protected function getData()
    method getMethod (line 43) | protected function getMethod()
    method getPath (line 53) | protected function getPath()
    method handleResult (line 70) | protected function handleResult($code, $headers, $data)

FILE: lib/Everyman/Neo4j/Cypher/Query.php
  class Query (line 14) | class Query implements Neo4j\Query
    method __construct (line 29) | public function __construct(Neo4j\Client $client, $template, $vars=arr...
    method getQuery (line 41) | public function getQuery()
    method getParameters (line 51) | public function getParameters()
    method getResultSet (line 61) | public function getResultSet()

FILE: lib/Everyman/Neo4j/EntityMapper.php
  class EntityMapper (line 8) | class EntityMapper
    method __construct (line 17) | public function __construct(Client $client)
    method getEntityFor (line 31) | public function getEntityFor($value)
    method getIdFromUri (line 53) | public function getIdFromUri($uri)
    method makeNode (line 65) | public function makeNode($data)
    method makeRelationship (line 77) | public function makeRelationship($data)
    method populateNode (line 90) | public function populateNode(Node $node, $data)
    method populatePath (line 105) | public function populatePath(Path $path, $data, $full=false)
    method populateRelationship (line 135) | public function populateRelationship(Relationship $rel, $data)
    method getNodeFromUri (line 153) | protected function getNodeFromUri($uri)
    method getRelationshipFromUri (line 165) | protected function getRelationshipFromUri($uri)

FILE: lib/Everyman/Neo4j/Exception.php
  class Exception (line 4) | class Exception extends \Exception
    method __construct (line 9) | public function __construct($message, $code=0, $headers=array(), $data...
    method getHeaders (line 20) | public function getHeaders()
    method getData (line 29) | public function getData()

FILE: lib/Everyman/Neo4j/Geoff.php
  class Geoff (line 9) | class Geoff
    method __construct (line 18) | public function __construct(Client $client)
    method dump (line 30) | public function dump($paths, $handle=null)
    method load (line 54) | public function load($handle, Batch $batch=null)

FILE: lib/Everyman/Neo4j/Geoff/Exporter.php
  class Exporter (line 10) | class Exporter
    method dump (line 18) | public function dump($paths, $handle)

FILE: lib/Everyman/Neo4j/Geoff/Importer.php
  class Importer (line 14) | class Importer
    method __construct (line 23) | public function __construct(Client $client)
    method load (line 38) | public function load($handle, Batch $batch=null)
    method loadLine (line 68) | protected function loadLine($line, Batch $batch, $lineNum, &$nodes, &$...

FILE: lib/Everyman/Neo4j/Gremlin/Query.php
  class Query (line 14) | class Query implements Neo4j\Query
    method __construct (line 29) | public function __construct(Neo4j\Client $client, $script, $vars=array())
    method getQuery (line 41) | public function getQuery()
    method getParameters (line 51) | public function getParameters()
    method getResultSet (line 61) | public function getResultSet()

FILE: lib/Everyman/Neo4j/Index.php
  class Index (line 7) | class Index
    method __construct (line 25) | public function __construct(Client $client, $type, $name, $config=arra...
    method add (line 41) | public function add($entity, $key, $value)
    method delete (line 51) | public function delete()
    method find (line 63) | public function find($key, $value)
    method findOne (line 75) | public function findOne($key, $value)
    method getConfig (line 89) | public function getConfig()
    method getName (line 99) | public function getName()
    method getType (line 109) | public function getType()
    method query (line 120) | public function query($query)
    method queryOne (line 131) | public function queryOne($query)
    method remove (line 148) | public function remove($entity, $key=null, $value=null)
    method save (line 158) | public function save()

FILE: lib/Everyman/Neo4j/Index/NodeFulltextIndex.php
  class NodeFulltextIndex (line 10) | class NodeFulltextIndex extends NodeIndex
    method __construct (line 19) | public function __construct(Client $client, $name, $config=array())

FILE: lib/Everyman/Neo4j/Index/NodeIndex.php
  class NodeIndex (line 10) | class NodeIndex extends Index
    method __construct (line 19) | public function __construct(Client $client, $name, $config=array())

FILE: lib/Everyman/Neo4j/Index/RelationshipIndex.php
  class RelationshipIndex (line 10) | class RelationshipIndex extends Index
    method __construct (line 19) | public function __construct(Client $client, $name, $config=array())

FILE: lib/Everyman/Neo4j/Label.php
  class Label (line 10) | class Label
    method __construct (line 28) | public function __construct(Client $client, $name)
    method setClient (line 44) | public function setClient(Client $client)
    method getClient (line 55) | public function getClient()
    method getName (line 65) | public function getName()
    method getNodes (line 81) | public function getNodes($propertyName=null, $propertyValue=null)
    method __sleep (line 91) | public function __sleep()

FILE: lib/Everyman/Neo4j/Node.php
  class Node (line 7) | class Node extends PropertyContainer
    method setClient (line 20) | public function setClient(Client $client)
    method addLabels (line 40) | public function addLabels($labels)
    method delete (line 52) | public function delete()
    method findPathsTo (line 66) | public function findPathsTo(Node $to, $type=null, $dir=null)
    method getFirstRelationship (line 89) | public function getFirstRelationship($types=array(), $dir=null)
    method getRelationships (line 105) | public function getRelationships($types=array(), $dir=null)
    method getLabels (line 116) | public function getLabels()
    method load (line 130) | public function load()
    method relateTo (line 143) | public function relateTo(Node $to, $type)
    method removeLabels (line 159) | public function removeLabels($labels)
    method save (line 171) | public function save()
    method __sleep (line 183) | public function __sleep()

FILE: lib/Everyman/Neo4j/Pager.php
  class Pager (line 7) | class Pager
    method __construct (line 24) | public function __construct(Traversal $traversal, Node $startNode, $re...
    method getId (line 36) | public function getId()
    method getLeaseTime (line 46) | public function getLeaseTime()
    method getNextResults (line 57) | public function getNextResults()
    method getPageSize (line 67) | public function getPageSize()
    method getReturnType (line 77) | public function getReturnType()
    method getStartNode (line 87) | public function getStartNode()
    method getTraversal (line 97) | public function getTraversal()
    method setId (line 108) | public function setId($id)
    method setLeaseTime (line 120) | public function setLeaseTime($leaseTime)
    method setPageSize (line 132) | public function setPageSize($pageSize)

FILE: lib/Everyman/Neo4j/Path.php
  class Path (line 7) | class Path implements \Countable, \IteratorAggregate
    method appendNode (line 22) | public function appendNode(Node $node)
    method appendRelationship (line 33) | public function appendRelationship(Relationship $rel)
    method count (line 43) | public function count()
    method getContext (line 53) | public function getContext()
    method getEndNode (line 63) | public function getEndNode()
    method getLength (line 77) | public function getLength()
    method getIterator (line 87) | public function getIterator()
    method getNodes (line 99) | public function getNodes()
    method getRelationships (line 109) | public function getRelationships()
    method getStartNode (line 119) | public function getStartNode()
    method setContext (line 134) | public function setContext($context)

FILE: lib/Everyman/Neo4j/PathFinder.php
  class PathFinder (line 7) | class PathFinder
    method __construct (line 30) | public function __construct(Client $client)
    method getAlgorithm (line 40) | public function getAlgorithm()
    method getClient (line 50) | public function getClient()
    method getCostProperty (line 60) | public function getCostProperty()
    method getDefaultCost (line 70) | public function getDefaultCost()
    method getDirection (line 80) | public function getDirection()
    method getEndNode (line 90) | public function getEndNode()
    method getMaxDepth (line 100) | public function getMaxDepth()
    method getPaths (line 110) | public function getPaths()
    method getSinglePath (line 120) | public function getSinglePath()
    method getStartNode (line 131) | public function getStartNode()
    method getType (line 141) | public function getType()
    method setAlgorithm (line 152) | public function setAlgorithm($algo)
    method setCostProperty (line 164) | public function setCostProperty($property)
    method setDefaultCost (line 176) | public function setDefaultCost($cost)
    method setDirection (line 188) | public function setDirection($dir)
    method setEndNode (line 200) | public function setEndNode(Node $end)
    method setMaxDepth (line 212) | public function setMaxDepth($max)
    method setStartNode (line 224) | public function setStartNode(Node $start)
    method setType (line 236) | public function setType($type)

FILE: lib/Everyman/Neo4j/PropertyContainer.php
  class PropertyContainer (line 7) | abstract class PropertyContainer
    method __construct (line 36) | public function __construct(Client $client)
    method __get (line 41) | public function __get($key)
    method __set (line 46) | public function __set($key, $value)
    method __unset (line 51) | public function __unset($key)
    method __isset (line 56) | public function __isset($key)
    method __sleep (line 61) | public function __sleep()
    method delete (line 72) | abstract public function delete();
    method load (line 80) | abstract public function load();
    method save (line 88) | abstract public function save();
    method getClient (line 95) | public function getClient()
    method getId (line 105) | public function getId()
    method getProperties (line 115) | public function getProperties()
    method getProperty (line 127) | public function getProperty($property)
    method hasId (line 138) | public function hasId()
    method removeProperty (line 149) | public function removeProperty($property)
    method setClient (line 162) | public function setClient(Client $client)
    method setId (line 174) | public function setId($id)
    method setProperties (line 186) | public function setProperties($properties)
    method setProperty (line 202) | public function setProperty($property, $value)
    method useLazyLoad (line 219) | public function useLazyLoad($lazyLoad)
    method loadProperties (line 231) | protected function loadProperties()

FILE: lib/Everyman/Neo4j/Query.php
  type Query (line 7) | interface Query
    method getQuery (line 14) | public function getQuery();
    method getResultSet (line 21) | public function getResultSet();

FILE: lib/Everyman/Neo4j/Query/ResultSet.php
  class ResultSet (line 10) | class ResultSet implements \Iterator, \Countable, \ArrayAccess
    method __construct (line 25) | public function __construct(Client $client, $result)
    method getColumns (line 39) | public function getColumns()
    method offsetExists (line 46) | public function offsetExists($offset)
    method offsetGet (line 51) | public function offsetGet($offset)
    method offsetSet (line 59) | public function offsetSet($offset, $value)
    method offsetUnset (line 64) | public function offsetUnset($offset)
    method count (line 72) | public function count()
    method rewind (line 80) | public function rewind()
    method current (line 85) | public function current()
    method key (line 90) | public function key()
    method next (line 95) | public function next()
    method valid (line 100) | public function valid()

FILE: lib/Everyman/Neo4j/Query/Row.php
  class Row (line 12) | class Row implements \Iterator, \Countable, \ArrayAccess
    method __construct (line 27) | public function __construct(Client $client, $columns, $rowData)
    method offsetExists (line 37) | public function offsetExists($offset)
    method offsetGet (line 53) | public function offsetGet($offset)
    method offsetSet (line 71) | public function offsetSet($offset, $value)
    method offsetUnset (line 76) | public function offsetUnset($offset)
    method count (line 84) | public function count()
    method rewind (line 92) | public function rewind()
    method current (line 97) | public function current()
    method key (line 102) | public function key()
    method next (line 107) | public function next()
    method valid (line 112) | public function valid()

FILE: lib/Everyman/Neo4j/Relationship.php
  class Relationship (line 7) | class Relationship extends PropertyContainer
    method setClient (line 32) | public function setClient(Client $client)
    method delete (line 51) | public function delete()
    method getEndNode (line 62) | public function getEndNode()
    method getStartNode (line 75) | public function getStartNode()
    method getType (line 88) | public function getType()
    method load (line 100) | public function load()
    method save (line 112) | public function save()
    method setEndNode (line 125) | public function setEndNode(Node $end)
    method setStartNode (line 137) | public function setStartNode(Node $start)
    method setType (line 149) | public function setType($type)
    method __sleep (line 161) | public function __sleep()

FILE: lib/Everyman/Neo4j/Transaction.php
  class Transaction (line 7) | class Transaction
    method __construct (line 19) | public function __construct(Client $client)
    method addStatements (line 31) | public function addStatements($statements, $commit=false)
    method commit (line 55) | public function commit()
    method getId (line 68) | public function getId()
    method isClosed (line 78) | public function isClosed()
    method isError (line 88) | public function isError()
    method keepAlive (line 98) | public function keepAlive()
    method rollback (line 111) | public function rollback()
    method setId (line 129) | public function setId($id)
    method performClientAction (line 146) | protected function performClientAction($action, $shouldClose, $require...

FILE: lib/Everyman/Neo4j/Transport.php
  class Transport (line 7) | abstract class Transport
    method __construct (line 29) | public function __construct($host='localhost', $port=7474)
    method getEndpoint (line 40) | public function getEndpoint()
    method encodeData (line 51) | public function encodeData($data)
    method makeRequest (line 84) | abstract public function makeRequest($method, $path, $data=array());
    method get (line 93) | public function get($path, $data=array())
    method post (line 105) | public function post($path, $data=array())
    method put (line 117) | public function put($path, $data=array())
    method delete (line 128) | public function delete($path)
    method setAuth (line 142) | public function setAuth($username=null, $password=null)
    method useHttps (line 157) | public function useHttps($useHttps=true)

FILE: lib/Everyman/Neo4j/Transport/Curl.php
  class Curl (line 11) | class Curl extends BaseTransport
    method __construct (line 18) | public function __construct($host='localhost', $port=7474)
    method __destruct (line 30) | public function __destruct()
    method makeRequest (line 40) | public function makeRequest($method, $path, $data=array())
    method getHandle (line 127) | protected function getHandle()

FILE: lib/Everyman/Neo4j/Transport/Stream.php
  class Stream (line 11) | class Stream extends BaseTransport
    method makeRequest (line 16) | public function makeRequest($method, $path, $data=array())

FILE: lib/Everyman/Neo4j/Traversal.php
  class Traversal (line 7) | class Traversal
    method __construct (line 45) | public function __construct(Client $client)
    method addRelationship (line 57) | public function addRelationship($type, $direction=null)
    method getClient (line 73) | public function getClient()
    method getMaxDepth (line 83) | public function getMaxDepth()
    method getOrder (line 93) | public function getOrder()
    method getPruneEvaluator (line 103) | public function getPruneEvaluator()
    method getRelationships (line 113) | public function getRelationships()
    method getResults (line 125) | public function getResults(Node $startNode, $returnType)
    method getReturnFilter (line 135) | public function getReturnFilter()
    method getSingleResult (line 147) | public function getSingleResult(Node $startNode, $returnType)
    method getUniqueness (line 158) | public function getUniqueness()
    method setMaxDepth (line 169) | public function setMaxDepth($max)
    method setOrder (line 181) | public function setOrder($order)
    method setPruneEvaluator (line 197) | public function setPruneEvaluator($language=null, $body=null)
    method setReturnFilter (line 226) | public function setReturnFilter($language=null, $body=null)
    method setUniqueness (line 251) | public function setUniqueness($uniqueness)

FILE: lib/Everyman/Neo4j/Version.php
  class Version (line 7) | class Version
    method userAgent (line 11) | public static function userAgent()

FILE: tests/unit/lib/Everyman/Neo4j/BatchTest.php
  class BatchTest (line 4) | class BatchTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testGetClient_ClientSetCorrectly_ReturnsClient (line 15) | public function testGetClient_ClientSetCorrectly_ReturnsClient()
    method testCommit_PassesSelfToClient_Success_ReturnsTrue (line 20) | public function testCommit_PassesSelfToClient_Success_ReturnsTrue()
    method testCommit_PassesSelfToClient_Failure_ReturnsFalse (line 30) | public function testCommit_PassesSelfToClient_Failure_ReturnsFalse()
    method testCommit_CommitMoreThanOnce_ThrowsException (line 40) | public function testCommit_CommitMoreThanOnce_ThrowsException()
    method testSave_PropertyContainerEntities_ReturnsIntegerOperationIndex (line 50) | public function testSave_PropertyContainerEntities_ReturnsIntegerOpera...
    method testSave_SameEntityMoreThanOnce_ReturnsIntegerOperationIndex (line 71) | public function testSave_SameEntityMoreThanOnce_ReturnsIntegerOperatio...
    method testDelete_PropertyContainerEntities_ReturnsIntegerOperationIndex (line 79) | public function testDelete_PropertyContainerEntities_ReturnsIntegerOpe...
    method testDelete_SameEntityMoreThanOnce_ReturnsIntegerOperationIndex (line 100) | public function testDelete_SameEntityMoreThanOnce_ReturnsIntegerOperat...
    method testAddToIndex_Index_ReturnsIntegerOperationIndex (line 108) | public function testAddToIndex_Index_ReturnsIntegerOperationIndex()
    method testAddToIndex_SameEntitySameKeyValueMoreThanOnce_ReturnsIntegerOperationIndex (line 122) | public function testAddToIndex_SameEntitySameKeyValueMoreThanOnce_Retu...
    method testRemoveFromIndex_Index_ReturnsIntegerOperationIndex (line 131) | public function testRemoveFromIndex_Index_ReturnsIntegerOperationIndex()
    method testRemoveFromIndex_SameEntitySameKeyValueMoreThanOnce_ReturnsIntegerOperationIndex (line 146) | public function testRemoveFromIndex_SameEntitySameKeyValueMoreThanOnce...
    method testGetOperations_MixedOperations_ReturnsOperations (line 161) | public function testGetOperations_MixedOperations_ReturnsOperations()
    method testReserve_OperationNotReserved_ReturnsOperation (line 178) | public function testReserve_OperationNotReserved_ReturnsOperation()
    method testReserve_OperationAlreadyReserved_ReturnsFalse (line 190) | public function testReserve_OperationAlreadyReserved_ReturnsFalse()
    method testReserve_OperationNotExists_ReturnsFalse (line 200) | public function testReserve_OperationNotExists_ReturnsFalse()

FILE: tests/unit/lib/Everyman/Neo4j/Cache/MemcacheTest.php
  class MemcacheTest (line 4) | class MemcacheTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testSet_PassesThroughToMemcache (line 19) | public function testSet_PassesThroughToMemcache()
    method testGet_PassesThroughToMemcache (line 29) | public function testGet_PassesThroughToMemcache()
    method testDelete_PassesThroughToMemcache (line 39) | public function testDelete_PassesThroughToMemcache()

FILE: tests/unit/lib/Everyman/Neo4j/Cache/MemcachedTest.php
  class MemcachedTest (line 4) | class MemcachedTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testSet_PassesThroughToMemcached (line 22) | public function testSet_PassesThroughToMemcached()
    method testGet_PassesThroughToMemcached (line 32) | public function testGet_PassesThroughToMemcached()
    method testDelete_PassesThroughToMemcached (line 42) | public function testDelete_PassesThroughToMemcached()

FILE: tests/unit/lib/Everyman/Neo4j/Cache/NoneTest.php
  class NoneTest (line 4) | class NoneTest extends \PHPUnit_Framework_TestCase
    method setUp (line 8) | public function setUp()
    method testDelete_ReturnsTrue (line 13) | public function testDelete_ReturnsTrue()
    method testGet_ReturnsFalse (line 18) | public function testGet_ReturnsFalse()
    method testSet_ReturnsTrue (line 23) | public function testSet_ReturnsTrue()

FILE: tests/unit/lib/Everyman/Neo4j/Cache/VariableTest.php
  class VariableTest (line 4) | class VariableTest extends \PHPUnit_Framework_TestCase
    method setUp (line 8) | public function setUp()
    method testSet_ReturnsTrue (line 13) | public function testSet_ReturnsTrue()
    method testGet_KeyDoesNotExist_ReturnsFalse (line 18) | public function testGet_KeyDoesNotExist_ReturnsFalse()
    method testGet_KeyExists_ReturnsValue (line 23) | public function testGet_KeyExists_ReturnsValue()
    method testGet_ExpiredValue_ReturnsFalse (line 29) | public function testGet_ExpiredValue_ReturnsFalse()
    method testDelete_KeyDoesNotExist_ReturnsTrue (line 35) | public function testDelete_KeyDoesNotExist_ReturnsTrue()
    method testDelete_KeyExists_ReturnsTrue (line 40) | public function testDelete_KeyExists_ReturnsTrue()

FILE: tests/unit/lib/Everyman/Neo4j/ClientTest.php
  class ClientTest (line 4) | class ClientTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testConstruct_TransportGiven_SetsTransport (line 19) | public function testConstruct_TransportGiven_SetsTransport()
    method testConstruct_NoTransportGiven_SetsCreateTransport (line 24) | public function testConstruct_NoTransportGiven_SetsCreateTransport()
    method testConstruct_HostAndPortGiven_SetsCreateTransport (line 32) | public function testConstruct_HostAndPortGiven_SetsCreateTransport()
    method testDeleteNode_NodeDeleted_ReturnsTrue (line 40) | public function testDeleteNode_NodeDeleted_ReturnsTrue()
    method testDeleteNode_NodeNotFound_ThrowsException (line 53) | public function testDeleteNode_NodeNotFound_ThrowsException()
    method testDeleteNode_TransportError_ThrowsException (line 67) | public function testDeleteNode_TransportError_ThrowsException()
    method testDeleteNode_NodeHasNoId_ThrowsException (line 81) | public function testDeleteNode_NodeHasNoId_ThrowsException()
    method testSaveNode_Update_NodeHasNoId_ThrowsException (line 89) | public function testSaveNode_Update_NodeHasNoId_ThrowsException()
    method testSaveNode_UpdateNodeFound_ReturnsTrue (line 98) | public function testSaveNode_UpdateNodeFound_ReturnsTrue()
    method testSaveNode_UpdateNodeNotFound_ThrowsException (line 119) | public function testSaveNode_UpdateNodeNotFound_ThrowsException()
    method testSaveNode_Update_TransportError_ThrowsException (line 140) | public function testSaveNode_Update_TransportError_ThrowsException()
    method testSaveNode_Create_ReturnsTrue (line 161) | public function testSaveNode_Create_ReturnsTrue()
    method testSaveNode_Create_TransportError_ThrowsException (line 183) | public function testSaveNode_Create_TransportError_ThrowsException()
    method testSaveNode_CreateNoProperties_ReturnsSuccess (line 202) | public function testSaveNode_CreateNoProperties_ReturnsSuccess()
    method testGetNode_TransportError_ThrowsException (line 215) | public function testGetNode_TransportError_ThrowsException()
    method testGetNode_NotFound_ReturnsNull (line 228) | public function testGetNode_NotFound_ReturnsNull()
    method testGetNode_Force_ReturnsNode (line 240) | public function testGetNode_Force_ReturnsNode()
    method testGetNode_Found_ReturnsNode (line 252) | public function testGetNode_Found_ReturnsNode()
    method testLoadNode_NodeNotFound_ThrowsException (line 272) | public function testLoadNode_NodeNotFound_ThrowsException()
    method testLoadNode_NodeHasNoId_ThrowsException (line 287) | public function testLoadNode_NodeHasNoId_ThrowsException()
    method testGetRelationship_TransportError_ThrowsException (line 295) | public function testGetRelationship_TransportError_ThrowsException()
    method testGetRelationship_NotFound_ReturnsNull (line 308) | public function testGetRelationship_NotFound_ReturnsNull()
    method testGetRelationship_Force_ReturnsRelationship (line 320) | public function testGetRelationship_Force_ReturnsRelationship()
    method testGetRelationship_Found_ReturnsRelationship (line 332) | public function testGetRelationship_Found_ReturnsRelationship()
    method testGetRelationship_Found_LazyLoadNodes (line 371) | public function testGetRelationship_Found_LazyLoadNodes()
    method testLoadRelationship_RelationshipNotFound_ThrowsException (line 402) | public function testLoadRelationship_RelationshipNotFound_ThrowsExcept...
    method testLoadRelationship_RelationshipHasNoId_ThrowsException (line 417) | public function testLoadRelationship_RelationshipHasNoId_ThrowsExcepti...
    method testDeleteRelationship_Found_ReturnsTrue (line 425) | public function testDeleteRelationship_Found_ReturnsTrue()
    method testDeleteRelationship_NotFound_ThrowsException (line 438) | public function testDeleteRelationship_NotFound_ThrowsException()
    method testDeleteRelationship_TransportError_ThrowsException (line 452) | public function testDeleteRelationship_TransportError_ThrowsException()
    method testDeleteRelationship_RelationshipHasNoId_ThrowsException (line 466) | public function testDeleteRelationship_RelationshipHasNoId_ThrowsExcep...
    method testSaveRelationship_Create_NoStartNode_ThrowsException (line 474) | public function testSaveRelationship_Create_NoStartNode_ThrowsException()
    method testSaveRelationship_Create_NoEndNode_ThrowsException (line 482) | public function testSaveRelationship_Create_NoEndNode_ThrowsException()
    method testSaveRelationship_Create_NoType_ThrowsException (line 494) | public function testSaveRelationship_Create_NoType_ThrowsException()
    method testSaveRelationship_Create_ReturnsTrue (line 509) | public function testSaveRelationship_Create_ReturnsTrue()
    method testSaveRelationship_CreateNoData_ReturnsTrue (line 540) | public function testSaveRelationship_CreateNoData_ReturnsTrue()
    method testSaveRelationship_CreateTransportError_ThrowsException (line 567) | public function testSaveRelationship_CreateTransportError_ThrowsExcept...
    method testSaveRelationship_Update_RelationshipHasNoId_ThrowsException (line 598) | public function testSaveRelationship_Update_RelationshipHasNoId_Throws...
    method testSaveRelationship_UpdateFound_ReturnsTrue (line 607) | public function testSaveRelationship_UpdateFound_ReturnsTrue()
    method testSaveRelationship_UpdateNotFound_ReturnsFalse (line 627) | public function testSaveRelationship_UpdateNotFound_ReturnsFalse()
    method testSaveRelationship_UpdateTransportError_ThrowsException (line 648) | public function testSaveRelationship_UpdateTransportError_ThrowsExcept...
    method testGetNodeRelationships_NodeNotPersisted_ThrowsException (line 669) | public function testGetNodeRelationships_NodeNotPersisted_ThrowsExcept...
    method testGetNodeRelationships_NodeNotFound_ThrowsException (line 679) | public function testGetNodeRelationships_NodeNotFound_ThrowsException()
    method testGetNodeRelationships_NoRelationships_ReturnsEmptyArray (line 693) | public function testGetNodeRelationships_NoRelationships_ReturnsEmptyA...
    method testGetNodeRelationships_Relationships_ReturnsArray (line 708) | public function testGetNodeRelationships_Relationships_ReturnsArray()
    method testGetNodeRelationships_UrlCharactersInTypeName_EncodesCorrectly (line 757) | public function testGetNodeRelationships_UrlCharactersInTypeName_Encod...
    method testGetRelationshipTypes_ServerReturnsErrorCode_ThrowsException (line 771) | public function testGetRelationshipTypes_ServerReturnsErrorCode_Throws...
    method testGetRelationshipTypes_ServerReturnsArray_ReturnsArray (line 782) | public function testGetRelationshipTypes_ServerReturnsArray_ReturnsArr...
    method testGetServerInfo_ServerReturnsArray_ReturnsArray (line 793) | public function testGetServerInfo_ServerReturnsArray_ReturnsArray()
    method testGetServerInfo_GeneralAvailabilityRelease_ReturnsArray (line 824) | public function testGetServerInfo_GeneralAvailabilityRelease_ReturnsAr...
    method testGetServerInfo_UnsuccessfulResponse_ThrowsException (line 849) | public function testGetServerInfo_UnsuccessfulResponse_ThrowsException()
    method testStartBatch_MultipleCallsWithoutCommit_ReturnsSameBatch (line 860) | public function testStartBatch_MultipleCallsWithoutCommit_ReturnsSameB...
    method testStartBatch_CommitAndStartAnother_ReturnsNewBatch (line 869) | public function testStartBatch_CommitAndStartAnother_ReturnsNewBatch()
    method testStartBatch_CommitOpenedBatch_ReturnsNewBatch (line 887) | public function testStartBatch_CommitOpenedBatch_ReturnsNewBatch()
    method testStartBatch_CommitOtherBatch_ReturnsSameBatch (line 905) | public function testStartBatch_CommitOtherBatch_ReturnsSameBatch()
    method testStartBatch_EndBatch_ReturnsNewBatch (line 921) | public function testStartBatch_EndBatch_ReturnsNewBatch()
    method testCommitBatch_NoBatchGivenNoOpenBatch_ThrowsException (line 930) | public function testCommitBatch_NoBatchGivenNoOpenBatch_ThrowsException()
    method testCommitBatch_NoOperationsInBatch_ReturnsTrue (line 936) | public function testCommitBatch_NoOperationsInBatch_ReturnsTrue()
    method testMakeNode_ReturnsNode (line 945) | public function testMakeNode_ReturnsNode()
    method testMakeRelationship_ReturnsRelationship (line 958) | public function testMakeRelationship_ReturnsRelationship()
    method testGetReferenceNode_Found_ReturnsNode (line 971) | public function testGetReferenceNode_Found_ReturnsNode()
    method testNodeFactory_SetNodeFactory_ReturnsNodeFromFactory (line 984) | public function testNodeFactory_SetNodeFactory_ReturnsNodeFromFactory()
    method testNodeFactory_SetNodeFactory_NotCallable_ThrowsException (line 994) | public function testNodeFactory_SetNodeFactory_NotCallable_ThrowsExcep...
    method testNodeFactory_NodeFactoryReturnsNotNode_ThrowsException (line 1000) | public function testNodeFactory_NodeFactoryReturnsNotNode_ThrowsExcept...
    method testRelationshipFactory_SetRelationshipFactory_ReturnsRelationshipFromFactory (line 1010) | public function testRelationshipFactory_SetRelationshipFactory_Returns...
    method testRelationshipFactory_SetRelationshipFactory_NotCallable_ThrowsException (line 1020) | public function testRelationshipFactory_SetRelationshipFactory_NotCall...
    method testRelationshipFactory_RelationshipFactoryReturnsNotRelationship_ThrowsException (line 1026) | public function testRelationshipFactory_RelationshipFactoryReturnsNotR...
  class NodeFactoryTestClass_ClientTest (line 1037) | class NodeFactoryTestClass_ClientTest extends Node {}
  class RelFactoryTestClass_ClientTest (line 1038) | class RelFactoryTestClass_ClientTest extends Relationship {}

FILE: tests/unit/lib/Everyman/Neo4j/Client_Batch_IndexTest.php
  class Client_Batch_IndexTest (line 4) | class Client_Batch_IndexTest extends \PHPUnit_Framework_TestCase
    method setUp (line 11) | public function setUp()
    method testCommitBatch_AddToIndex_NodeExists_Success_ReturnsTrue (line 22) | public function testCommitBatch_AddToIndex_NodeExists_Success_ReturnsT...
    method testCommitBatch_AddToIndex_NodeDoesNotExist_Success_ReturnsTrue (line 47) | public function testCommitBatch_AddToIndex_NodeDoesNotExist_Success_Re...
    method testCommitBatch_AddToIndex_RelationshipExists_Success_ReturnsTrue (line 77) | public function testCommitBatch_AddToIndex_RelationshipExists_Success_...
    method testCommitBatch_AddToIndex_NoEntitiesExist_Success_ReturnsTrue (line 102) | public function testCommitBatch_AddToIndex_NoEntitiesExist_Success_Ret...
    method testCommitBatch_RemoveFromIndex_Entity_Success_ReturnsTrue (line 146) | public function testCommitBatch_RemoveFromIndex_Entity_Success_Returns...
    method testCommitBatch_RemoveFromIndex_EntityKey_Success_ReturnsTrue (line 165) | public function testCommitBatch_RemoveFromIndex_EntityKey_Success_Retu...
    method testCommitBatch_RemoveFromIndex_EntityKeyValue_Success_ReturnsTrue (line 184) | public function testCommitBatch_RemoveFromIndex_EntityKeyValue_Success...
    method setupTransportExpectation (line 203) | protected function setupTransportExpectation($request, $will)

FILE: tests/unit/lib/Everyman/Neo4j/Client_Batch_NodeTest.php
  class Client_Batch_NodeTest (line 4) | class Client_Batch_NodeTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testCommitBatch_TransportError_ThrowsException (line 20) | public function testCommitBatch_TransportError_ThrowsException()
    method testCommitBatch_CreateNode_Success_ReturnsTrue (line 32) | public function testCommitBatch_CreateNode_Success_ReturnsTrue()
    method testCommitBatch_UpdateNode_Success_ReturnsTrue (line 53) | public function testCommitBatch_UpdateNode_Success_ReturnsTrue()
    method testCommitBatch_DeleteNode_Success_ReturnsTrue (line 75) | public function testCommitBatch_DeleteNode_Success_ReturnsTrue()
    method setupTransportExpectation (line 95) | protected function setupTransportExpectation($request, $will)

FILE: tests/unit/lib/Everyman/Neo4j/Client_Batch_RelationshipTest.php
  class Client_Batch_RelationshipTest (line 4) | class Client_Batch_RelationshipTest extends \PHPUnit_Framework_TestCase
    method setUp (line 11) | public function setUp()
    method testCommitBatch_CreateRelationship_Success_ReturnsTrue (line 24) | public function testCommitBatch_CreateRelationship_Success_ReturnsTrue()
    method testCommitBatch_CreateRelationship_StartNodeUnidentified_ReturnsTrue (line 54) | public function testCommitBatch_CreateRelationship_StartNodeUnidentifi...
    method testCommitBatch_CreateRelationship_EndNodeUnidentified_ReturnsTrue (line 88) | public function testCommitBatch_CreateRelationship_EndNodeUnidentified...
    method testCommitBatch_CreateRelationship_NeitherNodeUnidentified_ReturnsTrue (line 124) | public function testCommitBatch_CreateRelationship_NeitherNodeUnidenti...
    method testCommitBatch_CreateRelationship_UnidentifiedNodeAlreadySavedInBatch_ReturnsTrue (line 163) | public function testCommitBatch_CreateRelationship_UnidentifiedNodeAlr...
    method testCommitBatch_UpdateRelationship_Success_ReturnsTrue (line 200) | public function testCommitBatch_UpdateRelationship_Success_ReturnsTrue()
    method testCommitBatch_DeleteRelationship_Success_ReturnsTrue (line 222) | public function testCommitBatch_DeleteRelationship_Success_ReturnsTrue()
    method testImplicitBatch_StartBatch_CloseBatch_ExpectedBatchRequest (line 242) | public function testImplicitBatch_StartBatch_CloseBatch_ExpectedBatchR...
    method setupTransportExpectation (line 313) | protected function setupTransportExpectation($request, $will)

FILE: tests/unit/lib/Everyman/Neo4j/Client_CacheTest.php
  class Client_CacheTest (line 4) | class Client_CacheTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testLoadNode_Found_NodeInCache (line 19) | public function testLoadNode_Found_NodeInCache()
    method testLoadNode_NotFound_NodeNotInCache (line 43) | public function testLoadNode_NotFound_NodeNotInCache()
    method testLoadRelationship_Found_RelationshipInCache (line 62) | public function testLoadRelationship_Found_RelationshipInCache()
    method testLoadRelationship_NotFound_RelationshipNotInCache (line 91) | public function testLoadRelationship_NotFound_RelationshipNotInCache()
    method testGetNode_Found_SubsequentCallsReturnsFromCache (line 111) | public function testGetNode_Found_SubsequentCallsReturnsFromCache()
    method testGetRelationship_Found_SubsequentCallsReturnsFromCache (line 124) | public function testGetRelationship_Found_SubsequentCallsReturnsFromCa...
    method testDeleteNode_Success_NodeNotInCache (line 144) | public function testDeleteNode_Success_NodeNotInCache()
    method testDeleteNode_Failure_NodeRemainsInCache (line 160) | public function testDeleteNode_Failure_NodeRemainsInCache()
    method testDeleteRelationship_Success_RelationshipNotInCache (line 180) | public function testDeleteRelationship_Success_RelationshipNotInCache()
    method testDeleteRelationship_Failure_RelationshipRemainsInCache (line 196) | public function testDeleteRelationship_Failure_RelationshipRemainsInCa...
    method testSaveNode_Success_NodeInCache (line 217) | public function testSaveNode_Success_NodeInCache()
    method testSaveNode_Failure_NodeNotInCache (line 233) | public function testSaveNode_Failure_NodeNotInCache()
    method testSaveRelationship_Success_RelationshipInCache (line 253) | public function testSaveRelationship_Success_RelationshipInCache()
    method testSaveRelationship_Failure_RelationshipNotInCache (line 269) | public function testSaveRelationship_Failure_RelationshipNotInCache()

FILE: tests/unit/lib/Everyman/Neo4j/Client_CypherTest.php
  class Client_CypherTest (line 4) | class Client_CypherTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testCypherQuery (line 22) | public function testCypherQuery($returnValue, $resultCount)
    method testCypherQuery_NewEndpoint (line 53) | public function testCypherQuery_NewEndpoint($returnValue, $resultCount)
    method testCypherQuery_ProxyHost (line 83) | public function testCypherQuery_ProxyHost($returnValue, $resultCount)
    method dataProvider_TestCypherQuery (line 116) | public function dataProvider_TestCypherQuery()
    method testCypherQuery_ServerReturnsErrorCode_ThrowsException (line 133) | public function testCypherQuery_ServerReturnsErrorCode_ThrowsException()
    method testCypherQuery_CypherNotAvailable_ThrowsException (line 159) | public function testCypherQuery_CypherNotAvailable_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Client_GremlinTest.php
  class Client_GremlinTest (line 4) | class Client_GremlinTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testGremlinQuery_ServerReturnsErrorCode_ReturnsFalse (line 25) | public function testGremlinQuery_ServerReturnsErrorCode_ReturnsFalse()
    method testGremlinQuery_DataAndColumnsReturned_ReturnsResultSet (line 42) | public function testGremlinQuery_DataAndColumnsReturned_ReturnsResultS...
    method testGremlinQuery_ListOfEntitiesReturned_ReturnsResultSet (line 67) | public function testGremlinQuery_ListOfEntitiesReturned_ReturnsResultS...
    method testGremlinQuery_SingleEntityReturned_ReturnsResultSet (line 87) | public function testGremlinQuery_SingleEntityReturned_ReturnsResultSet()
    method testGremlinQuery_ScalarValueReturned_ReturnsResultSet (line 106) | public function testGremlinQuery_ScalarValueReturned_ReturnsResultSet()
    method testGremlinQuery_GremlinNotAvailable_ThrowsException (line 121) | public function testGremlinQuery_GremlinNotAvailable_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Client_IndexTest.php
  class Client_IndexTest (line 4) | class Client_IndexTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testSaveIndex_UnknownIndexType_ThrowsException (line 19) | public function testSaveIndex_UnknownIndexType_ThrowsException()
    method testSaveIndex_NoName_ThrowsException (line 26) | public function testSaveIndex_NoName_ThrowsException()
    method testSaveIndex_ReturnsSuccess (line 36) | public function testSaveIndex_ReturnsSuccess($type, $name, $config, $r...
    method dataProvider_SaveIndexScenarios (line 52) | public function dataProvider_SaveIndexScenarios()
    method testSaveIndex_ServerError_ThrowsException (line 61) | public function testSaveIndex_ServerError_ThrowsException()
    method testDeleteIndex_UnknownIndexType_ThrowsException (line 76) | public function testDeleteIndex_UnknownIndexType_ThrowsException()
    method testDeleteIndex_NoName_ThrowsException (line 83) | public function testDeleteIndex_NoName_ThrowsException()
    method testDeleteIndex_ReturnsSuccess (line 93) | public function testDeleteIndex_ReturnsSuccess($type, $name, $config, ...
    method testDeleteIndex_ServerError_ThrowsException (line 105) | public function testDeleteIndex_ServerError_ThrowsException()
    method testDeleteIndex_UrlEntities_ReturnsCorrectSuccess (line 118) | public function testDeleteIndex_UrlEntities_ReturnsCorrectSuccess()
    method testDeleteIndex_NotFound_ReturnsSuccess (line 130) | public function testDeleteIndex_NotFound_ReturnsSuccess()
    method testAddToIndex_UnknownIndexType_ThrowsException (line 142) | public function testAddToIndex_UnknownIndexType_ThrowsException()
    method dataProvider_AddToIndexScenarios_NoName_ThrowsException (line 151) | public function dataProvider_AddToIndexScenarios_NoName_ThrowsException()
    method dataProvider_AddToIndexScenarios_WrongEntityType_ThrowsException (line 160) | public function dataProvider_AddToIndexScenarios_WrongEntityType_Throw...
    method testAddToIndex_EntityAdded_ReturnsSuccess (line 169) | public function testAddToIndex_EntityAdded_ReturnsSuccess()
    method testAddToIndex_UrlEntities_ReturnsCorrectSuccess (line 189) | public function testAddToIndex_UrlEntities_ReturnsCorrectSuccess()
    method testAddToIndex_ServerError_ThrowsException (line 209) | public function testAddToIndex_ServerError_ThrowsException()
    method testAddToIndex_BadIndexName_ThrowsException (line 230) | public function testAddToIndex_BadIndexName_ThrowsException()
    method testAddToIndex_EntityNotPersisted_ThrowsException (line 240) | public function testAddToIndex_EntityNotPersisted_ThrowsException()
    method testAddToIndex_BadType_ThrowsException (line 249) | public function testAddToIndex_BadType_ThrowsException()
    method testAddToIndex_BadKey_ThrowsException (line 259) | public function testAddToIndex_BadKey_ThrowsException()
    method testAddToIndex_RelationshipTypeMismatch_ThrowsException (line 269) | public function testAddToIndex_RelationshipTypeMismatch_ThrowsException()
    method testAddToIndex_NodeTypeMismatch_ThrowsException (line 279) | public function testAddToIndex_NodeTypeMismatch_ThrowsException()
    method testRemoveFromIndex_ReturnsSuccess (line 292) | public function testRemoveFromIndex_ReturnsSuccess($key, $value, $path...
    method dataProvider_RemoveFromIndexScenarios (line 306) | public function dataProvider_RemoveFromIndexScenarios()
    method testRemoveFromIndex_NotFound_ThrowsException (line 316) | public function testRemoveFromIndex_NotFound_ThrowsException()
    method testRemoveFromIndex_ServerError_ThrowsException (line 331) | public function testRemoveFromIndex_ServerError_ThrowsException()
    method testRemoveFromIndex_BadIndexName_ThrowsException (line 346) | public function testRemoveFromIndex_BadIndexName_ThrowsException()
    method testRemoveFromIndex_EntityNotPersisted_ThrowsException (line 356) | public function testRemoveFromIndex_EntityNotPersisted_ThrowsException()
    method testRemoveFromIndex_BadType_ThrowsException (line 365) | public function testRemoveFromIndex_BadType_ThrowsException()
    method testRemoveFromIndex_RelationshipTypeMismatch_ThrowsException (line 375) | public function testRemoveFromIndex_RelationshipTypeMismatch_ThrowsExc...
    method testRemoveFromIndex_NodeTypeMismatch_ThrowsException (line 385) | public function testRemoveFromIndex_NodeTypeMismatch_ThrowsException()
    method testSearchIndex_BadType_ThrowsException (line 395) | public function testSearchIndex_BadType_ThrowsException()
    method testSearchIndex_NoIndexName_ThrowsException (line 403) | public function testSearchIndex_NoIndexName_ThrowsException()
    method testSearchIndex_NoKeySpecified_ThrowsException (line 411) | public function testSearchIndex_NoKeySpecified_ThrowsException()
    method testSearchIndex_Error_ThrowsException (line 419) | public function testSearchIndex_Error_ThrowsException()
    method testSearchIndex_NodesFound_ReturnsArray (line 432) | public function testSearchIndex_NodesFound_ReturnsArray()
    method testSearchIndex_RelationshipsFound_ReturnsArray (line 464) | public function testSearchIndex_RelationshipsFound_ReturnsArray()
    method testSearchIndex_UrlEntities_ReturnsArray (line 496) | public function testSearchIndex_UrlEntities_ReturnsArray()
    method testQueryIndex_BadType_ThrowsException (line 519) | public function testQueryIndex_BadType_ThrowsException()
    method testQueryIndex_NoIndexName_ThrowsException (line 528) | public function testQueryIndex_NoIndexName_ThrowsException()
    method testQueryIndex_NoQuerySpecified_ThrowsException (line 537) | public function testQueryIndex_NoQuerySpecified_ThrowsException()
    method testQueryIndex_Error_ThrowsException (line 546) | public function testQueryIndex_Error_ThrowsException()
    method testQueryIndex_NodesFound_ReturnsArray (line 560) | public function testQueryIndex_NodesFound_ReturnsArray()
    method testQueryIndex_RelationshipsFound_ReturnsArray (line 593) | public function testQueryIndex_RelationshipsFound_ReturnsArray()
    method testGetIndexes_ServerError_ThrowsException (line 625) | public function testGetIndexes_ServerError_ThrowsException()
    method testGetIndexes_BadType_ThrowsException (line 636) | public function testGetIndexes_BadType_ThrowsException()
    method testGetIndexes_NoIndexes_ReturnsEmptyArray (line 642) | public function testGetIndexes_NoIndexes_ReturnsEmptyArray()
    method testGetIndexes_NodeType_ReturnsArray (line 654) | public function testGetIndexes_NodeType_ReturnsArray()
    method testGetIndexes_RelationshipType_ReturnsArray (line 690) | public function testGetIndexes_RelationshipType_ReturnsArray()

FILE: tests/unit/lib/Everyman/Neo4j/Client_LabelTest.php
  class Client_LabelTest (line 4) | class Client_LabelTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testMakeLabel_ReturnsLabel (line 29) | public function testMakeLabel_ReturnsLabel()
    method testMakeLabel_SameName_ReturnsSameLabelInstance (line 44) | public function testMakeLabel_SameName_ReturnsSameLabelInstance()
    method testGetNodesForLabel_NodesExistForLabel_ReturnsRow (line 56) | public function testGetNodesForLabel_NodesExistForLabel_ReturnsRow()
    method testGetNodesForLabel_NodesExistForLabelAndProperty_ReturnsRow (line 87) | public function testGetNodesForLabel_NodesExistForLabelAndProperty_Ret...
    method testGetNodesForLabel_NoNodesExist_ReturnsEmptyRow (line 114) | public function testGetNodesForLabel_NoNodesExist_ReturnsEmptyRow()
    method testGetNodesForLabel_ProperlyUrlEncodesPath (line 131) | public function testGetNodesForLabel_ProperlyUrlEncodesPath()
    method testGetNodesForLabel_PropertyWithIntegerValueGiven_CallsClientMethod (line 150) | public function testGetNodesForLabel_PropertyWithIntegerValueGiven_Cal...
    method testGetNodesForLabel_PropertyNameWithoutValue_ThrowsException (line 177) | public function testGetNodesForLabel_PropertyNameWithoutValue_ThrowsEx...
    method testGetNodesForLabel_PropertyValueWithoutName_ThrowsException (line 189) | public function testGetNodesForLabel_PropertyValueWithoutName_ThrowsEx...
    method testGetNodesForLabel_NoLabelCapability_ThrowsException (line 201) | public function testGetNodesForLabel_NoLabelCapability_ThrowsException()
    method testGetLabels_NoNode_ReturnsArrayOfLabelsAttachedToNodesOnTheServer (line 225) | public function testGetLabels_NoNode_ReturnsArrayOfLabelsAttachedToNod...
    method testGetLabels_NodeSpecified_ReturnsArrayOfLabelsAttachedToNode (line 246) | public function testGetLabels_NodeSpecified_ReturnsArrayOfLabelsAttach...
    method testGetLabels_NodeIdZero_ReturnsArrayOfLabelsAttachedToNode (line 267) | public function testGetLabels_NodeIdZero_ReturnsArrayOfLabelsAttachedT...
    method testGetLabels_NoNodeId_ThrowsException (line 288) | public function testGetLabels_NoNodeId_ThrowsException()
    method testGetLabels_NoLabelCapabiltiy_ThrowsException (line 299) | public function testGetLabels_NoLabelCapabiltiy_ThrowsException()
    method testAddLabels_SendsCorrectCypherQuery (line 320) | public function testAddLabels_SendsCorrectCypherQuery()
    method testAddLabels_NoLabelCapability_ThrowsException (line 367) | public function testAddLabels_NoLabelCapability_ThrowsException()
    method testAddLabels_NoNodeId_ThrowsException (line 395) | public function testAddLabels_NoNodeId_ThrowsException()
    method testAddLabels_NodeIdZero_DoesNotThrowException (line 409) | public function testAddLabels_NodeIdZero_DoesNotThrowException()
    method testAddLabels_NonLabelGiven_ThrowsException (line 438) | public function testAddLabels_NonLabelGiven_ThrowsException()
    method testAddLabels_NoLabelsGiven_ThrowsException (line 453) | public function testAddLabels_NoLabelsGiven_ThrowsException()
    method testRemoveLabels_SendsCorrectCypherQuery (line 465) | public function testRemoveLabels_SendsCorrectCypherQuery()
    method testRemoveLabels_NoLabelCapability_ThrowsException (line 508) | public function testRemoveLabels_NoLabelCapability_ThrowsException()
    method testRemoveLabels_NoNodeId_ThrowsException (line 536) | public function testRemoveLabels_NoNodeId_ThrowsException()
    method testRemoveLabels_NonLabelGiven_ThrowsException (line 550) | public function testRemoveLabels_NonLabelGiven_ThrowsException()
    method testRemoveLabels_NoLabelsGiven_ThrowsException (line 565) | public function testRemoveLabels_NoLabelsGiven_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Client_PathTest.php
  class Client_PathTest (line 4) | class Client_PathTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testGetPaths_PathsExist_ReturnsArray (line 19) | public function testGetPaths_PathsExist_ReturnsArray()
    method testGetPaths_NoMaxDepth_MaxDepthDefaultsToOne_ReturnsArray (line 101) | public function testGetPaths_NoMaxDepth_MaxDepthDefaultsToOne_ReturnsA...
    method testGetPaths_DirectionGivenButNoType_ThrowsException (line 133) | public function testGetPaths_DirectionGivenButNoType_ThrowsException()
    method testGetPaths_StartNodeNotPersisted_ThrowsException (line 149) | public function testGetPaths_StartNodeNotPersisted_ThrowsException()
    method testGetPaths_EndNodeNotPersisted_ThrowsException (line 163) | public function testGetPaths_EndNodeNotPersisted_ThrowsException()
    method testGetPaths_DijkstraSearchNoCostProperty_ThrowsException (line 177) | public function testGetPaths_DijkstraSearchNoCostProperty_ThrowsExcept...
    method testGetPaths_DijkstraSearch_ReturnsResult (line 193) | public function testGetPaths_DijkstraSearch_ReturnsResult()
    method testGetPaths_TransportFails_ThrowsException (line 229) | public function testGetPaths_TransportFails_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Client_TransactionTest.php
  class Client_TransactionTest (line 4) | class Client_TransactionTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testBeginTransaction_ReturnsNewTransactionWithNoId (line 23) | public function testBeginTransaction_ReturnsNewTransactionWithNoId()
    method testAddStatements_NewTransaction_ReturnsResultSetAndSetsTransactionId (line 30) | public function testAddStatements_NewTransaction_ReturnsResultSetAndSe...
    method testAddStatements_NoParams_ParamsSentAsEmptyObject (line 122) | public function testAddStatements_NoParams_ParamsSentAsEmptyObject()
    method testAddStatements_ExistingTransactionId_ReturnsResultSet (line 164) | public function testAddStatements_ExistingTransactionId_ReturnsResultS...
    method testAddStatements_TransactionFailed_ThrowsException (line 188) | public function testAddStatements_TransactionFailed_ThrowsException()
    method testAddStatements_ErrorsGiven_ThrowsException (line 209) | public function testAddStatements_ErrorsGiven_ThrowsException()
    method testAddStatements_NewTransactionWithCommit_ReturnsResulSet (line 230) | public function testAddStatements_NewTransactionWithCommit_ReturnsResu...
    method testAddStatements_ExistingTransactionWithCommit_ReturnsResulSet (line 249) | public function testAddStatements_ExistingTransactionWithCommit_Return...
    method testAddStatements_KeepAlive_HasTransactionId_SendsToTransportWithoutStatements (line 271) | public function testAddStatements_KeepAlive_HasTransactionId_SendsToTr...
    method testAddStatements_KeepAlive_NoTransactionId_ThrowsException (line 295) | public function testAddStatements_KeepAlive_NoTransactionId_ThrowsExce...
    method testAddStatements_NoTransactionCapability_ThrowsException (line 306) | public function testAddStatements_NoTransactionCapability_ThrowsExcept...
    method testRollback_HasTransactionId_SendsDelete (line 323) | public function testRollback_HasTransactionId_SendsDelete()
    method testRollback_NoTransactionId_ThrowsException (line 336) | public function testRollback_NoTransactionId_ThrowsException()
    method testRollback_NoTransactionCapability_ThrowsException (line 347) | public function testRollback_NoTransactionCapability_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Client_TraversalTest.php
  class Client_TraversalTest (line 4) | class Client_TraversalTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testTraversal_NoNodeId_ThrowsException (line 19) | public function testTraversal_NoNodeId_ThrowsException()
    method testTraversal_BadReturnType_ThrowsException (line 28) | public function testTraversal_BadReturnType_ThrowsException()
    method testTraversal_TraversalOptions_PassesThroughCorrectDataToTransport (line 41) | public function testTraversal_TraversalOptions_PassesThroughCorrectDat...
    method dataProvider_TestTraversal (line 55) | public function dataProvider_TestTraversal()
    method testTraversal_ReturnTypeNode_ReturnsArrayOfNodes (line 135) | public function testTraversal_ReturnTypeNode_ReturnsArrayOfNodes()
    method testTraversal_ReturnTypeRelationship_ReturnsArrayOfRelationships (line 162) | public function testTraversal_ReturnTypeRelationship_ReturnsArrayOfRel...
    method testTraversal_ReturnTypePath_ReturnsArrayOfPaths (line 196) | public function testTraversal_ReturnTypePath_ReturnsArrayOfPaths()
    method testTraversal_ReturnTypeFullPath_ReturnsArrayOfPaths (line 231) | public function testTraversal_ReturnTypeFullPath_ReturnsArrayOfPaths()
    method testTraversal_ServerReturnsErrorCode_ThrowsException (line 297) | public function testTraversal_ServerReturnsErrorCode_ThrowsException()
    method testPagedTraversal_TraversalGiven_ReturnsResultSets (line 312) | public function testPagedTraversal_TraversalGiven_ReturnsResultSets()
    method testPagedTraversal_ServerReturnsError_ThrowsException (line 377) | public function testPagedTraversal_ServerReturnsError_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Cypher/QueryTest.php
  class QueryTest (line 4) | class QueryTest extends \PHPUnit_Framework_TestCase
    method setUp (line 12) | public function setUp()
    method testGetQuery_ReturnsString (line 21) | public function testGetQuery_ReturnsString()
    method testGetParameters_ReturnsArray (line 27) | public function testGetParameters_ReturnsArray()
    method testGetResultSet_OnlyExecutesOnce_ReturnsResultSet (line 33) | public function testGetResultSet_OnlyExecutesOnce_ReturnsResultSet()
    method testGetResultSet_ClientReturnsFalse_ReturnsFalse (line 45) | public function testGetResultSet_ClientReturnsFalse_ReturnsFalse()

FILE: tests/unit/lib/Everyman/Neo4j/EntityMapperTest.php
  class EntityMapperTest (line 4) | class EntityMapperTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testGetIdFromUri_UriGiven_ReturnsInteger (line 16) | public function testGetIdFromUri_UriGiven_ReturnsInteger()
    method testMakeNode_NodeDataGiven_ReturnsNode (line 22) | public function testMakeNode_NodeDataGiven_ReturnsNode()
    method testMakeRelationship_RelationshipDataGiven_ReturnsRelationship (line 38) | public function testMakeRelationship_RelationshipDataGiven_ReturnsRela...
    method testPopulateNode_NodeGiven_ReturnsNode (line 62) | public function testPopulateNode_NodeGiven_ReturnsNode()
    method testPopulateRelationship_RelationshipGiven_ReturnsRelationship (line 76) | public function testPopulateRelationship_RelationshipGiven_ReturnsRela...
    method testPopulatePath_PathGiven_ReturnsPath (line 98) | public function testPopulatePath_PathGiven_ReturnsPath()
    method testPopulatePath_FullPath_ReturnsPath (line 125) | public function testPopulatePath_FullPath_ReturnsPath()
    method testGetEntityFor_RelationshipData_ReturnsRelationship (line 179) | public function testGetEntityFor_RelationshipData_ReturnsRelationship()
    method testGetEntityFor_NodeData_ReturnsNode (line 203) | public function testGetEntityFor_NodeData_ReturnsNode()
    method testGetEntityFor_PathData_ReturnsPath (line 219) | public function testGetEntityFor_PathData_ReturnsPath()

FILE: tests/unit/lib/Everyman/Neo4j/GeoffTest.php
  class GeoffTest (line 4) | class GeoffTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testLoad_NotAStreamOrString_ThrowsException (line 16) | public function testLoad_NotAStreamOrString_ThrowsException()
    method testLoad_IgnoreEmptyLines_ReturnsBatch (line 24) | public function testLoad_IgnoreEmptyLines_ReturnsBatch()
    method testLoad_IgnoreCommentLines_ReturnsBatch (line 32) | public function testLoad_IgnoreCommentLines_ReturnsBatch()
    method testLoad_LoadNodeLines_ReturnsBatch (line 42) | public function testLoad_LoadNodeLines_ReturnsBatch()
    method testLoad_DuplicateNodeLines_ThrowsException (line 72) | public function testLoad_DuplicateNodeLines_ThrowsException()
    method testLoad_RelationshipEndpointsDefined_ReturnsBatch (line 81) | public function testLoad_RelationshipEndpointsDefined_ReturnsBatch()
    method testLoad_RelationshipUndefinedStart_ThrowsException (line 113) | public function testLoad_RelationshipUndefinedStart_ThrowsException()
    method testLoad_RelationshipUndefinedEnd_ThrowsException (line 122) | public function testLoad_RelationshipUndefinedEnd_ThrowsException()
    method testLoad_DuplicateRelationshipLines_ThrowsException (line 131) | public function testLoad_DuplicateRelationshipLines_ThrowsException()
    method testLoad_IndexLines_ReturnsBatch (line 142) | public function testLoad_IndexLines_ReturnsBatch()
    method testLoad_IndexLinesInvalidNode_ThrowsException (line 208) | public function testLoad_IndexLinesInvalidNode_ThrowsException()
    method testLoad_IndexLinesInvalidRelationship_ThrowsException (line 217) | public function testLoad_IndexLinesInvalidRelationship_ThrowsException()
    method testLoad_IndexBracketMismatch_ThrowsException (line 225) | public function testLoad_IndexBracketMismatch_ThrowsException()
    method testLoad_InvalidLine_ThrowsException (line 236) | public function testLoad_InvalidLine_ThrowsException()
    method testLoad_UseTheSameBatch_ReturnsBatch (line 246) | public function testLoad_UseTheSameBatch_ReturnsBatch()
    method testDump_PathsGiven_NoFileDescriptor_ReturnsString (line 265) | public function testDump_PathsGiven_NoFileDescriptor_ReturnsString()
    method testDump_PathsGiven_FileDescriptor_ReturnsDescriptor (line 305) | public function testDump_PathsGiven_FileDescriptor_ReturnsDescriptor()
    method testDump_NotAStreamOrString_ThrowsException (line 333) | public function testDump_NotAStreamOrString_ThrowsException()
    method testDump_NotAPath_ThrowsException (line 342) | public function testDump_NotAPath_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Gremlin/QueryTest.php
  class QueryTest (line 4) | class QueryTest extends \PHPUnit_Framework_TestCase
    method setUp (line 12) | public function setUp()
    method testGetQuery_ReturnsString (line 21) | public function testGetQuery_ReturnsString()
    method testGetParameters_ReturnsArray (line 27) | public function testGetParameters_ReturnsArray()
    method testGetResultSet_OnlyExecutesOnce_ReturnsResultSet (line 33) | public function testGetResultSet_OnlyExecutesOnce_ReturnsResultSet()
    method testGetResultSet_ClientReturnsFalse_ReturnsFalse (line 45) | public function testGetResultSet_ClientReturnsFalse_ReturnsFalse()

FILE: tests/unit/lib/Everyman/Neo4j/IndexTest.php
  class IndexTest (line 4) | class IndexTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testSave_SavesSelfUsingClient (line 15) | public function testSave_SavesSelfUsingClient()
    method testDelete_DeletesSelfUsingClient (line 25) | public function testDelete_DeletesSelfUsingClient()
    method testAdd_AddsEntityUsingClient (line 35) | public function testAdd_AddsEntityUsingClient()
    method testRemove_RemovesEntityUsingClient (line 47) | public function testRemove_RemovesEntityUsingClient()
    method testFind_FindsNodesUsingClient (line 59) | public function testFind_FindsNodesUsingClient()
    method testFindOne_FindsNodesUsingClient (line 73) | public function testFindOne_FindsNodesUsingClient()
    method testFindOne_NoNode_ReturnsNull (line 87) | public function testFindOne_NoNode_ReturnsNull()
    method testQuery_QueriesUsingClient (line 98) | public function testQuery_QueriesUsingClient()
    method testQueryOne_QueriesUsingClient (line 112) | public function testQueryOne_QueriesUsingClient()
    method testQueryOne_NoNode_ReturnsNull (line 126) | public function testQueryOne_NoNode_ReturnsNull()
    method testNodeIndex_CreatesNodeIndex (line 137) | public function testNodeIndex_CreatesNodeIndex()
    method testNodeFulltextIndex_CreatesNodeFulltextIndex (line 145) | public function testNodeFulltextIndex_CreatesNodeFulltextIndex()
    method testRelationshipIndex_CreatesRelationshipIndex (line 156) | public function testRelationshipIndex_CreatesRelationshipIndex()

FILE: tests/unit/lib/Everyman/Neo4j/LabelTest.php
  class LabelTest (line 4) | class LabelTest extends \PHPUnit_Framework_TestCase
    method setUp (line 8) | public function setUp()
    method dataProvider_ValidNames (line 13) | public function dataProvider_ValidNames()
    method testContruct_ValidNameGiven_SetsNameCastAsString (line 25) | public function testContruct_ValidNameGiven_SetsNameCastAsString($name)
    method dataProvider_InvalidNames (line 32) | public function dataProvider_InvalidNames()
    method testContruct_InvalidNameGiven_ThrowsException (line 47) | public function testContruct_InvalidNameGiven_ThrowsException($name)
    method testGetNodes_NoPropertyGiven_CallsClientMethod (line 53) | public function testGetNodes_NoPropertyGiven_CallsClientMethod()
    method testGetNodes_PropertyGiven_CallsClientMethod (line 64) | public function testGetNodes_PropertyGiven_CallsClientMethod()

FILE: tests/unit/lib/Everyman/Neo4j/NodeTest.php
  class NodeTest (line 4) | class NodeTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testSave_SavesSelfUsingClient (line 24) | public function testSave_SavesSelfUsingClient()
    method testGetLabels_DelegatesToClient (line 42) | public function testGetLabels_DelegatesToClient()
    method testAddLabels_DelegatesToClient (line 62) | public function testAddLabels_DelegatesToClient()
    method testRemoveLabels_DelegatesToClient (line 84) | public function testRemoveLabels_DelegatesToClient()
    method testSave_FollowedByPropertyGet_DoesNotLazyLoad (line 109) | public function testSave_FollowedByPropertyGet_DoesNotLazyLoad()
    method testDelete_DeletesSelfUsingClient (line 123) | public function testDelete_DeletesSelfUsingClient()
    method testLoad_LoadsSelfUsingClient (line 133) | public function testLoad_LoadsSelfUsingClient()
    method testGetRelationships_ReturnsArrayOfRelationships (line 143) | public function testGetRelationships_ReturnsArrayOfRelationships()
    method testGetFirstRelationship_ReturnsRelationship (line 162) | public function testGetFirstRelationship_ReturnsRelationship()
    method testGetFirstRelationship_NoneFound_ReturnsNull (line 181) | public function testGetFirstRelationship_NoneFound_ReturnsNull()
    method testRelateTo_ReturnsRelationship (line 197) | public function testRelateTo_ReturnsRelationship()
    method testFindPathsTo_ReturnsPathFinder (line 210) | public function testFindPathsTo_ReturnsPathFinder()
    method testSerialize_KeepsLabels (line 224) | public function testSerialize_KeepsLabels()

FILE: tests/unit/lib/Everyman/Neo4j/PagerTest.php
  class PagerTest (line 4) | class PagerTest extends \PHPUnit_Framework_TestCase
    method setUp (line 12) | public function setUp()
    method testConstruct_SetsParametersCorrectly_ReturnsCorrectValues (line 25) | public function testConstruct_SetsParametersCorrectly_ReturnsCorrectVa...
    method testPageSize_NoneGiven_ReturnsNull (line 32) | public function testPageSize_NoneGiven_ReturnsNull()
    method testPageSize_PageSizeGiven_ReturnsInteger (line 37) | public function testPageSize_PageSizeGiven_ReturnsInteger()
    method testLeaseTime_NoneGiven_ReturnsNull (line 43) | public function testLeaseTime_NoneGiven_ReturnsNull()
    method testLeaseTime_LeaseTimeGiven_ReturnsInteger (line 48) | public function testLeaseTime_LeaseTimeGiven_ReturnsInteger()
    method testId_NoneGiven_ReturnsNull (line 54) | public function testId_NoneGiven_ReturnsNull()
    method testId_IdGiven_ReturnsString (line 59) | public function testId_IdGiven_ReturnsString()
    method testGetNextResults_PassesThroughToClient (line 65) | public function testGetNextResults_PassesThroughToClient()

FILE: tests/unit/lib/Everyman/Neo4j/PathFinderTest.php
  class PathFinderTest (line 4) | class PathFinderTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testGetClient_ClientSetCorrectly_ReturnsClient (line 15) | public function testGetClient_ClientSetCorrectly_ReturnsClient()
    method testGetPaths_PassesThroughToClient (line 20) | public function testGetPaths_PassesThroughToClient()
    method testGetSinglePath_PassesThroughToClient (line 33) | public function testGetSinglePath_PassesThroughToClient()
    method testGetSinglePath_NoPaths_ReturnsNull (line 47) | public function testGetSinglePath_NoPaths_ReturnsNull()

FILE: tests/unit/lib/Everyman/Neo4j/PathTest.php
  class PathTest (line 4) | class PathTest extends \PHPUnit_Framework_TestCase
    method setUp (line 12) | public function setUp()
    method testGetLength_ReturnsInteger (line 46) | public function testGetLength_ReturnsInteger()
    method testEndpoints_ReturnsCorrectNodes (line 57) | public function testEndpoints_ReturnsCorrectNodes()
    method testEndpoints_NoRelationship_ReturnsNull (line 63) | public function testEndpoints_NoRelationship_ReturnsNull()
    method testGetRelationships_ReturnsArray (line 70) | public function testGetRelationships_ReturnsArray()
    method testGetNodes_ReturnsArray (line 78) | public function testGetNodes_ReturnsArray()
    method testIteration_PathCanBeIteratedOver (line 88) | public function testIteration_PathCanBeIteratedOver()
    method testContext_UnknownContextSet_SetsContextToNode (line 101) | public function testContext_UnknownContextSet_SetsContextToNode()

FILE: tests/unit/lib/Everyman/Neo4j/PropertyContainerTest.php
  class PropertyContainerTest (line 4) | class PropertyContainerTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testProperties_MagicNotSet_ReturnsNull (line 16) | public function testProperties_MagicNotSet_ReturnsNull()
    method testProperties_MagicSet_ReturnsValue (line 21) | public function testProperties_MagicSet_ReturnsValue()
    method testProperties_MagicRemoved_ReturnsNull (line 27) | public function testProperties_MagicRemoved_ReturnsNull()
    method testProperties_PropertyNotSet_ReturnsNull (line 34) | public function testProperties_PropertyNotSet_ReturnsNull()
    method testProperties_PropertySet_ReturnsValue (line 39) | public function testProperties_PropertySet_ReturnsValue()
    method testProperties_PropertyRemoved_ReturnsNull (line 45) | public function testProperties_PropertyRemoved_ReturnsNull()
    method testProperties_BatchSet_ReturnsValues (line 52) | public function testProperties_BatchSet_ReturnsValues()
    method testProperties_GetAllProperties_ReturnsValues (line 62) | public function testProperties_GetAllProperties_ReturnsValues()
    method testProperties_SetPropertyNullValue_ReturnsNullAndPropertyRemoved (line 74) | public function testProperties_SetPropertyNullValue_ReturnsNullAndProp...
    method testProperties_LazyLoad_OnlyLoadsTheFirstTime (line 89) | public function testProperties_LazyLoad_OnlyLoadsTheFirstTime()
    method testSetGetId_IntegerId_ReturnsInteger (line 99) | public function testSetGetId_IntegerId_ReturnsInteger()
    method testSetGetId_ZeroIdIsValid_ReturnsInteger (line 106) | public function testSetGetId_ZeroIdIsValid_ReturnsInteger()
    method testSetGetId_NullValid_ReturnsNull (line 113) | public function testSetGetId_NullValid_ReturnsNull()
    method testSetGetId_NonIntegerCastToInteger_ReturnsInteger (line 120) | public function testSetGetId_NonIntegerCastToInteger_ReturnsInteger()

FILE: tests/unit/lib/Everyman/Neo4j/Query/ResultSetTest.php
  class ResultSetTest (line 6) | class ResultSetTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testCount (line 15) | public function testCount()
    method testIterate (line 30) | public function testIterate()
    method testArrayAccess (line 49) | public function testArrayAccess()
    method testArrayAccess_CacheResultRows (line 75) | public function testArrayAccess_CacheResultRows()
    method testArrayAccess_Set_ThrowsException (line 92) | public function testArrayAccess_Set_ThrowsException()
    method testArrayAccess_Unset_ThrowsException (line 109) | public function testArrayAccess_Unset_ThrowsException()

FILE: tests/unit/lib/Everyman/Neo4j/Query/RowTest.php
  class RowTest (line 8) | class RowTest extends \PHPUnit_Framework_TestCase
    method setUp (line 12) | public function setUp()
    method testCount (line 17) | public function testCount()
    method testIterate (line 26) | public function testIterate()
    method testIterateWithNull (line 40) | public function testIterateWithNull()
    method testArrayAccess (line 55) | public function testArrayAccess()
    method testArrayAccess_Set_ThrowsException (line 74) | public function testArrayAccess_Set_ThrowsException()
    method testArrayAccess_Unset_ThrowsException (line 84) | public function testArrayAccess_Unset_ThrowsException()
    method testNodeCasting (line 94) | public function testNodeCasting()
    method testRelationshipCasting (line 112) | public function testRelationshipCasting()
    method testValueArray_ReturnsAsANewRowObject (line 132) | public function testValueArray_ReturnsAsANewRowObject()

FILE: tests/unit/lib/Everyman/Neo4j/RelationshipTest.php
  class RelationshipTest (line 4) | class RelationshipTest extends \PHPUnit_Framework_TestCase
    method setUp (line 10) | public function setUp()
    method testSave_SavesSelfUsingClient (line 16) | public function testSave_SavesSelfUsingClient()
    method testSave_FollowedByPropertyGet_DoesNotLazyLoad (line 36) | public function testSave_FollowedByPropertyGet_DoesNotLazyLoad()
    method testDelete_DeletesSelfUsingClient (line 50) | public function testDelete_DeletesSelfUsingClient()
    method testLoad_LoadsSelfUsingClient (line 60) | public function testLoad_LoadsSelfUsingClient()
    method testGetStartNode_NodeNotSet_LazyLoad (line 70) | public function testGetStartNode_NodeNotSet_LazyLoad()
    method testGetEndNode_NodeNotSet_LazyLoad (line 79) | public function testGetEndNode_NodeNotSet_LazyLoad()
    method testGetStartAndEndNode_NodesSet_DoesNotLazyLoad (line 88) | public function testGetStartAndEndNode_NodesSet_DoesNotLazyLoad()
    method testSerialize_KeepsStartEndAndType (line 104) | public function testSerialize_KeepsStartEndAndType()

FILE: tests/unit/lib/Everyman/Neo4j/TransactionTest.php
  class TransactionTest (line 7) | class TransactionTest extends \PHPUnit_Framework_TestCase
    method setUp (line 13) | public function setUp()
    method testSetId_CorrectlySetsId (line 20) | public function testSetId_CorrectlySetsId()
    method testSetId_SameIdSetAgain_CorrectlySetsId (line 25) | public function testSetId_SameIdSetAgain_CorrectlySetsId()
    method testSetId_DifferentIdSet_ThrowsException (line 32) | public function testSetId_DifferentIdSet_ThrowsException()
    method testCommit_DelegatesToClient (line 39) | public function testCommit_DelegatesToClient()
    method testCommit_NoId_NoopAndMarksTransactionClosed (line 50) | public function testCommit_NoId_NoopAndMarksTransactionClosed()
    method testCommit_ClosedTransaction_ThrowsException (line 62) | public function testCommit_ClosedTransaction_ThrowsException()
    method testCommit_ClientException_MarksTransactionClosedAndErrorAndThrowsException (line 70) | public function testCommit_ClientException_MarksTransactionClosedAndEr...
    method testRollback_DelegatesToClient (line 88) | public function testRollback_DelegatesToClient()
    method testRollback_NoTransactionId_NoopAndMarksTransactionClosed (line 99) | public function testRollback_NoTransactionId_NoopAndMarksTransactionCl...
    method testRollback_ClosedTransaction_ThrowsException (line 111) | public function testRollback_ClosedTransaction_ThrowsException()
    method testRollback_ClientException_MarksTransactionClosedAndErrorAndThrowsException (line 119) | public function testRollback_ClientException_MarksTransactionClosedAnd...
    method testKeepAlive_DelegatesToClient (line 137) | public function testKeepAlive_DelegatesToClient()
    method testKeepAlive_NoTransactionId_Noop (line 148) | public function testKeepAlive_NoTransactionId_Noop()
    method testKeepAlive_ClosedTransaction_ThrowsException (line 160) | public function testKeepAlive_ClosedTransaction_ThrowsException()
    method testKeepAlive_ClientException_MarksTransactionClosedAndErrorAndThrowsException (line 168) | public function testKeepAlive_ClientException_MarksTransactionClosedAn...
    method testAddStatements_NoId_DelegatesToClient (line 186) | public function testAddStatements_NoId_DelegatesToClient()
    method testAddStatements_DelegatesToClient (line 209) | public function testAddStatements_DelegatesToClient()
    method testAddStatements_SingleQuery_WrapsQueryInArrayBeforeSendingToClient (line 230) | public function testAddStatements_SingleQuery_WrapsQueryInArrayBeforeS...
    method testAddStatements_NoCommit_TransactionOpen (line 246) | public function testAddStatements_NoCommit_TransactionOpen()
    method testAddStatements_ClosedTransaction_ThrowsException (line 258) | public function testAddStatements_ClosedTransaction_ThrowsException()
    method testAddStatements_ClientException_MarksTransactionClosedAndErrorAndThrowsException (line 269) | public function testAddStatements_ClientException_MarksTransactionClos...

FILE: tests/unit/lib/Everyman/Neo4j/TransportTest.php
  class TransportTest (line 4) | class TransportTest extends \PHPUnit_Framework_TestCase
    method setUp (line 11) | public function setUp()
    method testConstants_MakeSureNothingSillyHappensLikeMisnamingTheConstants_ReturnsCorrectString (line 16) | public function testConstants_MakeSureNothingSillyHappensLikeMisnaming...
    method testGetEndpoint_ReturnsCorrectEndpointUrl (line 24) | public function testGetEndpoint_ReturnsCorrectEndpointUrl()
    method testGetEndpoint_UseHttps_ReturnsCorrectEndpointUrl (line 29) | public function testGetEndpoint_UseHttps_ReturnsCorrectEndpointUrl()
    method testDelete_MakesRequestWithCorrectParams (line 35) | public function testDelete_MakesRequestWithCorrectParams()
    method testPut_MakesRequestWithCorrectParams (line 47) | public function testPut_MakesRequestWithCorrectParams()
    method testPost_MakesRequestWithCorrectParams (line 59) | public function testPost_MakesRequestWithCorrectParams()
    method testGet_MakesRequestWithCorrectParams (line 71) | public function testGet_MakesRequestWithCorrectParams()
    method testEncodeData_StringGiven_ReturnsString (line 83) | public function testEncodeData_StringGiven_ReturnsString()
    method testEncodeData_ArrayWithNonNumericKeys_ReturnsString (line 91) | public function testEncodeData_ArrayWithNonNumericKeys_ReturnsString()
    method testEncodeData_ArrayWithNumericKeys_ReturnsString (line 109) | public function testEncodeData_ArrayWithNumericKeys_ReturnsString()
    method testEncodeData_EmptyArray_ReturnsString (line 127) | public function testEncodeData_EmptyArray_ReturnsString()

FILE: tests/unit/lib/Everyman/Neo4j/TraversalTest.php
  class TraversalTest (line 4) | class TraversalTest extends \PHPUnit_Framework_TestCase
    method setUp (line 9) | public function setUp()
    method testGetClient_ClientSetCorrectly_ReturnsClient (line 15) | public function testGetClient_ClientSetCorrectly_ReturnsClient()
    method testOrder_NoneGiven_ReturnsNull (line 20) | public function testOrder_NoneGiven_ReturnsNull()
    method testOrder_OrderGiven_ReturnsString (line 25) | public function testOrder_OrderGiven_ReturnsString()
    method testUniqueness_NoneGiven_ReturnsNull (line 31) | public function testUniqueness_NoneGiven_ReturnsNull()
    method testUniqueness_UniquenessGiven_ReturnsString (line 36) | public function testUniqueness_UniquenessGiven_ReturnsString()
    method testMaxDepth_NoneGiven_ReturnsNull (line 42) | public function testMaxDepth_NoneGiven_ReturnsNull()
    method testMaxDepth_MaxDepthGiven_ReturnsInteger (line 47) | public function testMaxDepth_MaxDepthGiven_ReturnsInteger()
    method testRelationships_NoneGiven_ReturnsEmptyArray (line 53) | public function testRelationships_NoneGiven_ReturnsEmptyArray()
    method testRelationships_TypeGivenAndDirectionGiven_ReturnsArray (line 59) | public function testRelationships_TypeGivenAndDirectionGiven_ReturnsAr...
    method testPruneEvaluator_NoneGiven_ReturnsNull (line 71) | public function testPruneEvaluator_NoneGiven_ReturnsNull()
    method testPruneEvaluator_LanguageAndBody_ReturnsArray (line 76) | public function testPruneEvaluator_LanguageAndBody_ReturnsArray()
    method testPruneEvaluator_BuiltIn_ReturnsArray (line 85) | public function testPruneEvaluator_BuiltIn_ReturnsArray()
    method testPruneEvaluator_Reset_ReturnsNull (line 94) | public function testPruneEvaluator_Reset_ReturnsNull()
    method testReturnFilter_NoneGiven_ReturnsNull (line 102) | public function testReturnFilter_NoneGiven_ReturnsNull()
    method testReturnFilter_LanguageAndBody_ReturnsArray (line 107) | public function testReturnFilter_LanguageAndBody_ReturnsArray()
    method testReturnFilter_BuiltIn_ReturnsArray (line 116) | public function testReturnFilter_BuiltIn_ReturnsArray()
    method testReturnFilter_Reset_ReturnsNull (line 125) | public function testReturnFilter_Reset_ReturnsNull()
    method testGetResults_PassesThroughToClient (line 133) | public function testGetResults_PassesThroughToClient()
    method testGetSingleResult_PassesThroughToClient (line 148) | public function testGetSingleResult_PassesThroughToClient()
    method testGetSingleResult_NoResults_ReturnsNull (line 164) | public function testGetSingleResult_NoResults_ReturnsNull()
Condensed preview — 135 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (480K chars).
[
  {
    "path": ".gitignore",
    "chars": 54,
    "preview": "neo4jphp.phar\nbuild\ndocs\nvendor/\n/.idea/\ncomposer.lock"
  },
  {
    "path": ".travis.yml",
    "chars": 195,
    "preview": "language: php\nphp:\n  - 5.3\n  - 5.4\n  - 5.5\n\nbefore_script:\n    - pecl install -f memcached-2.1.0\n    - phpenv config-add"
  },
  {
    "path": "LICENSE",
    "chars": 1180,
    "preview": "All project code is licensed under the MIT License\nhttp://www.opensource.org/licenses/mit-license.php\n\nCopyright (c) 201"
  },
  {
    "path": "Neo4jPhpVersionTask.php",
    "chars": 404,
    "preview": "<?php\nrequire_once __DIR__.'/lib/Everyman/Neo4j/Version.php';\n\nclass Neo4jPhpVersionTask extends Task\n{\n\tprotected $prop"
  },
  {
    "path": "README.md",
    "chars": 4183,
    "preview": "Neo4jPHP\n========\nAuthor: Josh Adell <josh.adell@gmail.com>  \nCopyright (c) 2011-2012\n\nPHP Wrapper for the Neo4j graph d"
  },
  {
    "path": "build.xml",
    "chars": 1877,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"Neo4jPHP\" default=\"test\">\n\t<taskdef name=\"neo4jphpversion\" classna"
  },
  {
    "path": "composer.json",
    "chars": 611,
    "preview": "{\n  \"name\": \"everyman/neo4jphp\",\n  \"type\": \"library\",\n  \"description\": \"Wrapper for the Neo4j graph database REST interf"
  },
  {
    "path": "docblox.dist.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<docblox>\n\t<files>\n\t\t<directory>lib</directory>\n\t</files>\n\t<parser>\n\t\t<target>do"
  },
  {
    "path": "examples/bacon.php",
    "chars": 2554,
    "preview": "#!/usr/bin/env php\n<?php\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index\\NodeIndex,\n\tEveryman\\Neo4j\\Relationship,\n\tEver"
  },
  {
    "path": "examples/batch_benchmarks.php",
    "chars": 3644,
    "preview": "#!/usr/bin/env php\n<?php\nnamespace Everyman\\Neo4j;\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\Rel"
  },
  {
    "path": "examples/cypher.php",
    "chars": 2275,
    "preview": "#!/usr/bin/env php\n<?php\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index\\NodeIndex,\n\tEveryman\\Neo4j\\Relationship,\n\tEver"
  },
  {
    "path": "examples/directions.php",
    "chars": 4934,
    "preview": "#!/usr/bin/env php\n<?php\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index\\NodeIndex,\n\tEveryman\\Neo4j\\Path,\n\tEveryman\\Neo"
  },
  {
    "path": "examples/example_bootstrap.php",
    "chars": 304,
    "preview": "<?php\nerror_reporting(-1);\nini_set('display_errors', 1);\nspl_autoload_register(function ($sClass) {\n\t$sLibPath = __DIR__"
  },
  {
    "path": "examples/gremlin.php",
    "chars": 2046,
    "preview": "#!/usr/bin/env php\n<?php\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index\\NodeIndex,\n\tEveryman\\Neo4j\\Relationship,\n\tEver"
  },
  {
    "path": "examples/indexing.php",
    "chars": 1285,
    "preview": "#!/usr/bin/env php\n<?php\nuse Everyman\\Neo4j\\Client,\n    Everyman\\Neo4j\\Index\\NodeIndex,\n    Everyman\\Neo4j\\Index\\Relatio"
  },
  {
    "path": "examples/widgets.php",
    "chars": 3292,
    "preview": "#!/usr/bin/env php\n<?php\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index\\NodeIndex,\n\tEveryman\\Neo4j\\Path,\n\tEveryman\\Neo"
  },
  {
    "path": "lib/Everyman/Neo4j/Batch/AddTo.php",
    "chars": 1711,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Batch;\n\nuse Everyman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\Command\\Batch as Command,\n\tEveryman\\Neo"
  },
  {
    "path": "lib/Everyman/Neo4j/Batch/Delete.php",
    "chars": 1086,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Batch;\n\nuse Everyman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\Command\\Batch as Command,\n\tEveryman\\Neo"
  },
  {
    "path": "lib/Everyman/Neo4j/Batch/Operation.php",
    "chars": 1713,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Batch;\n\nuse Everyman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\PropertyContainer;\n\n/**\n * A single ope"
  },
  {
    "path": "lib/Everyman/Neo4j/Batch/RemoveFrom.php",
    "chars": 1365,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Batch;\n\nuse Everyman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\Command\\Batch as Command,\n\tEveryman\\Neo"
  },
  {
    "path": "lib/Everyman/Neo4j/Batch/Save.php",
    "chars": 1421,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Batch;\n\nuse Everyman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\Command\\Batch as Command,\n\tEveryman\\Neo"
  },
  {
    "path": "lib/Everyman/Neo4j/Batch.php",
    "chars": 3418,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * A set of operations expected to succeed (or fail) atomically\n */\nclass Batch\n{\n\t"
  },
  {
    "path": "lib/Everyman/Neo4j/Cache/EntityCache.php",
    "chars": 2436,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n\tEveryman\\Neo4j\\PropertyCon"
  },
  {
    "path": "lib/Everyman/Neo4j/Cache/Memcache.php",
    "chars": 1343,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nuse Everyman\\Neo4j\\Cache;\n\n/**\n * Use the Memcache extension\n */\nclass Memcache i"
  },
  {
    "path": "lib/Everyman/Neo4j/Cache/Memcached.php",
    "chars": 1353,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nuse Everyman\\Neo4j\\Cache;\n\n/**\n * Use the Memcached extension\n */\nclass Memcached"
  },
  {
    "path": "lib/Everyman/Neo4j/Cache/None.php",
    "chars": 728,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nuse Everyman\\Neo4j\\Cache;\n\n/**\n * Cache that always indicates success but does no"
  },
  {
    "path": "lib/Everyman/Neo4j/Cache/Variable.php",
    "chars": 1818,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nuse Everyman\\Neo4j\\Cache;\n\n/**\n * Cache everything locally to the process\n * Valu"
  },
  {
    "path": "lib/Everyman/Neo4j/Cache.php",
    "chars": 966,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Interface for interacting with a caching backend\n */\ninterface Cache\n{\n\t/**\n\t * "
  },
  {
    "path": "lib/Everyman/Neo4j/Client.php",
    "chars": 18999,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Point of interaction between client and neo4j server\n */\nclass Client\n{\n\tconst E"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/AddLabels.php",
    "chars": 471,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command\\SetLabels,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\N"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/AddStatementsToTransaction.php",
    "chars": 3301,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/AddToIndex.php",
    "chars": 2647,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/AddToIndex.php",
    "chars": 1687,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index,\n\tEveryman\\Neo4j\\Batch,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/Command.php",
    "chars": 1603,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Command as SingleCommand,\n\tEveryman\\Neo4j\\Client;\n\n/**"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/Commit.php",
    "chars": 1211,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Batch;\n\n/**\n * Commit a batch "
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/CreateNode.php",
    "chars": 798,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Node,\n\tEveryman\\Neo4j\\Command\\"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/CreateRelationship.php",
    "chars": 1982,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Batch,\n\tEveryman\\Neo4j\\Relatio"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/DeleteNode.php",
    "chars": 761,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Node,\n\tEveryman\\Neo4j\\Command\\"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/DeleteRelationship.php",
    "chars": 822,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Relationship,\n\tEveryman\\Neo4j\\"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/RemoveFromIndex.php",
    "chars": 1008,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index,\n\tEveryman\\Neo4j\\Batch,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/UpdateNode.php",
    "chars": 798,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Node,\n\tEveryman\\Neo4j\\Command\\"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/Batch/UpdateRelationship.php",
    "chars": 859,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command\\Batch;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Relationship,\n\tEveryman\\Neo4j\\"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/CreateNode.php",
    "chars": 1345,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Node;\n\n/**\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/CreateRelationship.php",
    "chars": 2078,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/DeleteIndex.php",
    "chars": 1528,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/DeleteNode.php",
    "chars": 1368,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/DeleteRelationship.php",
    "chars": 1432,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/ExecuteCypherQuery.php",
    "chars": 1621,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Exception,\n\tEveryman\\Neo4j\\EntityMapper,\n\tEveryman\\Neo4j\\Com"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/ExecuteGremlinQuery.php",
    "chars": 2254,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\EntityMapper,\n\tEveryman\\Neo4j\\Exception,\n\tEveryman\\Neo4j\\Com"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/ExecutePagedTraversal.php",
    "chars": 2042,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Pager;\n\n/**\n * Perform a paged trave"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/ExecuteTraversal.php",
    "chars": 4031,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Exception,\n\tEveryman\\Neo4j\\Client,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetIndexes.php",
    "chars": 1549,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index,\n\tEve"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetLabels.php",
    "chars": 1583,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Node;\n\n/**\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetNode.php",
    "chars": 1437,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetNodeRelationships.php",
    "chars": 1997,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetNodesForLabel.php",
    "chars": 2277,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Label,\n\tEve"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetPaths.php",
    "chars": 2695,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetRelationship.php",
    "chars": 1529,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetRelationshipTypes.php",
    "chars": 918,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client;\n\n/**\n * Get all relationshi"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/GetServerInfo.php",
    "chars": 1405,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client;\n\n/**\n * Get information abo"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/QueryIndex.php",
    "chars": 797,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/RemoveFromIndex.php",
    "chars": 2760,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/RemoveLabels.php",
    "chars": 481,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command\\SetLabels,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\N"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/RollbackTransaction.php",
    "chars": 1535,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/SaveIndex.php",
    "chars": 1586,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/SearchIndex.php",
    "chars": 2164,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/SetLabels.php",
    "chars": 2054,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command\\ExecuteCypherQuery,\n\tEveryman\\Neo4j\\Client,\n\tEveryma"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/UpdateNode.php",
    "chars": 1389,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command/UpdateRelationship.php",
    "chars": 1465,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Command;\n\nuse Everyman\\Neo4j\\Command,\n\tEveryman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Command.php",
    "chars": 2380,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Abstract the parameters needed to make a request and parse the response\n */\nabst"
  },
  {
    "path": "lib/Everyman/Neo4j/Cypher/Query.php",
    "chars": 1337,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cypher;\n\nuse Everyman\\Neo4j;\n\n/**\n * Represents a Cypher query string and variables\n * Qu"
  },
  {
    "path": "lib/Everyman/Neo4j/EntityMapper.php",
    "chars": 3668,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Used to convert arbitrary arrays into Nodes and Relationships\n * where appropria"
  },
  {
    "path": "lib/Everyman/Neo4j/Exception.php",
    "chars": 549,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Exception extends \\Exception\n{\n\tprotected $headers;\n\tprotected $data;\n\n\tpublic fu"
  },
  {
    "path": "lib/Everyman/Neo4j/Geoff/Exporter.php",
    "chars": 1454,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Geoff;\n\nuse Everyman\\Neo4j\\Exception,\n\tEveryman\\Neo4j\\Path;\n\n/**\n * Export an array of Pa"
  },
  {
    "path": "lib/Everyman/Neo4j/Geoff/Importer.php",
    "chars": 4442,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Geoff;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Exception,\n\tEveryman\\Neo4j\\Node,\n\tEver"
  },
  {
    "path": "lib/Everyman/Neo4j/Geoff.php",
    "chars": 1274,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Implementation of GEOFF - Graph Export Object File Format\n * From http://py2neo."
  },
  {
    "path": "lib/Everyman/Neo4j/Gremlin/Query.php",
    "chars": 1306,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Gremlin;\n\nuse Everyman\\Neo4j;\n\n/**\n * Represents a Gremlin query\n * Query the database us"
  },
  {
    "path": "lib/Everyman/Neo4j/Index/NodeFulltextIndex.php",
    "chars": 589,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Index;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index\\NodeIndex;\n\n/**\n * Represents a "
  },
  {
    "path": "lib/Everyman/Neo4j/Index/NodeIndex.php",
    "chars": 430,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Index;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index;\n\n/**\n * Represents a node index"
  },
  {
    "path": "lib/Everyman/Neo4j/Index/RelationshipIndex.php",
    "chars": 454,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Index;\n\nuse Everyman\\Neo4j\\Client,\n\tEveryman\\Neo4j\\Index;\n\n/**\n * Represents a relationsh"
  },
  {
    "path": "lib/Everyman/Neo4j/Index.php",
    "chars": 2914,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents an index in the database\n */\nclass Index\n{\n\tconst TypeNode = 'node';\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Label.php",
    "chars": 1692,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents a single label\n *\n * Labels cannot be saved standalone; instead, they"
  },
  {
    "path": "lib/Everyman/Neo4j/Node.php",
    "chars": 3563,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents a single node in the database\n */\nclass Node extends PropertyContaine"
  },
  {
    "path": "lib/Everyman/Neo4j/Pager.php",
    "chars": 2167,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Holds the parameters for running a paged traversal\n */\nclass Pager\n{\n\tprotected "
  },
  {
    "path": "lib/Everyman/Neo4j/Path.php",
    "chars": 2454,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents collection of relationships joining two nodes\n */\nclass Path implemen"
  },
  {
    "path": "lib/Everyman/Neo4j/PathFinder.php",
    "chars": 3637,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Holds the parameters for finding a path between two nodes\n */\nclass PathFinder\n{"
  },
  {
    "path": "lib/Everyman/Neo4j/PropertyContainer.php",
    "chars": 4012,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents an entity that is a collection of properties\n */\nabstract class Prope"
  },
  {
    "path": "lib/Everyman/Neo4j/Query/ResultSet.php",
    "chars": 1820,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Query;\n\nuse Everyman\\Neo4j\\Client;\n\n/**\n * This is what you get when you execute a query."
  },
  {
    "path": "lib/Everyman/Neo4j/Query/Row.php",
    "chars": 2157,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Query;\n\nuse Everyman\\Neo4j\\Client;\n\n/**\n * Represents a single result row from a query.\n "
  },
  {
    "path": "lib/Everyman/Neo4j/Query.php",
    "chars": 303,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents a query (e. g. Gremlin or Cypher)\n */\ninterface Query\n{\n\t/**\n\t * Get "
  },
  {
    "path": "lib/Everyman/Neo4j/Relationship.php",
    "chars": 2672,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Represents a relationship between two nodes\n */\nclass Relationship extends Prope"
  },
  {
    "path": "lib/Everyman/Neo4j/Transaction.php",
    "chars": 3468,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * A transaction context for multiple Cypher statements across multiple requests\n *"
  },
  {
    "path": "lib/Everyman/Neo4j/Transport/Curl.php",
    "chars": 3014,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Transport;\n\nuse Everyman\\Neo4j\\Transport as BaseTransport,\n\tEveryman\\Neo4j\\Version,\n\tEver"
  },
  {
    "path": "lib/Everyman/Neo4j/Transport/Stream.php",
    "chars": 2153,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Transport;\n\nuse Everyman\\Neo4j\\Transport as BaseTransport,\n\tEveryman\\Neo4j\\Version,\n\tEver"
  },
  {
    "path": "lib/Everyman/Neo4j/Transport.php",
    "chars": 3084,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Class for communicating with an HTTP JSON endpoint\n */\nabstract class Transport\n"
  },
  {
    "path": "lib/Everyman/Neo4j/Traversal.php",
    "chars": 5044,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Holds the parameters for running a traversal\n */\nclass Traversal\n{\n\tconst Return"
  },
  {
    "path": "lib/Everyman/Neo4j/Version.php",
    "chars": 191,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\n/**\n * Current library version\n */\nclass Version\n{\n\tconst CURRENT = '0.1.0';\n\n\tpublic s"
  },
  {
    "path": "phpconfig.ini",
    "chars": 52,
    "preview": "extension = \"memcache.so\"\nextension = \"memcached.so\""
  },
  {
    "path": "stub.php",
    "chars": 1662,
    "preview": "<?php\ntrigger_error('The neo4jphp PHAR archive is no longer supported and will be removed in the future. Use Composer to"
  },
  {
    "path": "tests/cs/ruleset.xml",
    "chars": 1375,
    "preview": "<?xml version=\"1.0\"?>\n<ruleset name=\"Neo4jPHP\">\n\t<description>Code style guidelines for the Neo4jPHP library</descriptio"
  },
  {
    "path": "tests/phpunit.xml",
    "chars": 379,
    "preview": "<phpunit\n\tbootstrap=\"../vendor/autoload.php\"\n\tcolors=\"true\"\n\tconvertErrorsToExceptions=\"true\"\n\tconvertNoticesToException"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/BatchTest.php",
    "chars": 6589,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass BatchTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tprote"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Cache/MemcacheTest.php",
    "chars": 1152,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nclass MemcacheTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $memcache = n"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Cache/MemcachedTest.php",
    "chars": 1372,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nclass MemcachedTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $memcached ="
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Cache/NoneTest.php",
    "chars": 500,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nclass NoneTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $cache = null;\n\n\t"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Cache/VariableTest.php",
    "chars": 1103,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cache;\n\nclass VariableTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $cache = null"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/ClientTest.php",
    "chars": 29533,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass ClientTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = null;\n\tp"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_Batch_IndexTest.php",
    "chars": 6490,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_Batch_IndexTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transpor"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_Batch_NodeTest.php",
    "chars": 3139,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_Batch_NodeTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_Batch_RelationshipTest.php",
    "chars": 11204,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_Batch_RelationshipTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $t"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_CacheTest.php",
    "chars": 7587,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_CacheTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = nu"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_CypherTest.php",
    "chars": 5271,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_CypherTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = n"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_GremlinTest.php",
    "chars": 4729,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_GremlinTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = "
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_IndexTest.php",
    "chars": 22846,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_IndexTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = nu"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_LabelTest.php",
    "chars": 17175,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_LabelTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = nu"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_PathTest.php",
    "chars": 8002,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_PathTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport = nul"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_TransactionTest.php",
    "chars": 11355,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_TransactionTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transpor"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Client_TraversalTest.php",
    "chars": 12639,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass Client_TraversalTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $transport "
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Cypher/QueryTest.php",
    "chars": 1488,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Cypher;\n\nclass QueryTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/EntityMapperTest.php",
    "chars": 7876,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass EntityMapperTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/GeoffTest.php",
    "chars": 14182,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass GeoffTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tprote"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Gremlin/QueryTest.php",
    "chars": 1512,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Gremlin;\n\nclass QueryTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/IndexTest.php",
    "chars": 4645,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass IndexTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tprote"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/LabelTest.php",
    "chars": 1599,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass LabelTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\n\tpubl"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/NodeTest.php",
    "chars": 7150,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass NodeTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tprotec"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/PagerTest.php",
    "chars": 2068,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass PagerTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tprote"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/PathFinderTest.php",
    "chars": 1472,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass PathFinderTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\t"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/PathTest.php",
    "chars": 3061,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass PathTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tprotec"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/PropertyContainerTest.php",
    "chars": 3405,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass PropertyContainerTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = "
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Query/ResultSetTest.php",
    "chars": 2653,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Query;\n\nuse Everyman\\Neo4j\\Client;\n\nclass ResultSetTest extends \\PHPUnit_Framework_TestCa"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/Query/RowTest.php",
    "chars": 4101,
    "preview": "<?php\nnamespace Everyman\\Neo4j\\Query;\n\nuse Everyman\\Neo4j\\Client,\n    Everyman\\Neo4j\\Node,\n    Everyman\\Neo4j\\Relationsh"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/RelationshipTest.php",
    "chars": 3994,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass RelationshipTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/TransactionTest.php",
    "chars": 8551,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nuse Everyman\\Neo4j\\Cypher\\Query,\n    Everyman\\Neo4j\\Query\\ResultSet;\n\nclass Transaction"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/TransportTest.php",
    "chars": 4098,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass TransportTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $host = 'foo.com';"
  },
  {
    "path": "tests/unit/lib/Everyman/Neo4j/TraversalTest.php",
    "chars": 5406,
    "preview": "<?php\nnamespace Everyman\\Neo4j;\n\nclass TraversalTest extends \\PHPUnit_Framework_TestCase\n{\n\tprotected $client = null;\n\tp"
  }
]

About this extraction

This page contains the full source code of the jadell/neo4jphp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 135 files (416.3 KB), approximately 131.6k tokens, and a symbol index with 1082 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!