Constants

ErrorUnknown

ErrorUnknown

ErrorBadRequest

ErrorBadRequest

ErrorNotFound

ErrorNotFound

ErrorConflict

ErrorConflict

RefNodeId

RefNodeId

Properties

$transport

$transport : 

Type

$entityMapper

$entityMapper : 

Type

$entityCache

$entityCache : 

Type

$serverInfo

$serverInfo : 

Type

$openBatch

$openBatch : 

Type

Methods

__construct()

__construct(mixed $transport, integer $port)

Initialize the client

Parameters

mixed $transport

Transport object or string hostname

integer $port

Ignored unless $transport is a hostname

addToIndex()

addToIndex(\Everyman\Neo4j\Index $index, \Everyman\Neo4j\PropertyContainer $entity, string $key, string $value) : boolean

Add an entity to an index

Parameters

\Everyman\Neo4j\Index $index
\Everyman\Neo4j\PropertyContainer $entity
string $key
string $value

Returns

boolean

commitBatch()

commitBatch(\Everyman\Neo4j\Batch $batch) : boolean

Commit a batch of operations

Parameters

\Everyman\Neo4j\Batch $batch

Returns

boolean —

true on success

deleteIndex()

deleteIndex(\Everyman\Neo4j\Index $index) : boolean

Delete the given index

Parameters

\Everyman\Neo4j\Index $index

Returns

boolean

deleteNode()

deleteNode(\Everyman\Neo4j\Node $node) : boolean

Delete the given node

Parameters

\Everyman\Neo4j\Node $node

Returns

boolean

deleteRelationship()

deleteRelationship(\Everyman\Neo4j\Relationship $relationship) : boolean

Delete the given relationship

Parameters

\Everyman\Neo4j\Relationship $relationship

Returns

boolean

endBatch()

endBatch() : \Everyman\Neo4j\Client

Detach the current open batch.

The batch can still be committed via the batch returned by Client::startBatch()

Returns

\Everyman\Neo4j\Client

executePagedTraversal()

executePagedTraversal(\Everyman\Neo4j\Pager $pager) : array

Execute a paged traversal and return the result

Parameters

\Everyman\Neo4j\Pager $pager

Returns

array

executeTraversal()

executeTraversal(\Everyman\Neo4j\Traversal $traversal, \Everyman\Neo4j\Node $startNode, string $returnType) : array

Execute the given traversal and return the result

Parameters

\Everyman\Neo4j\Traversal $traversal
\Everyman\Neo4j\Node $startNode
string $returnType

Returns

array

getIndexes()

getIndexes(string $type) : mixed

Get all indexes of the given type

Parameters

string $type

Returns

mixed —

false on error, else an array of Index objects

getNode()

getNode(integer $id, boolean $force) : \Everyman\Neo4j\Node

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.

Parameters

integer $id
boolean $force

Returns

\Everyman\Neo4j\Node

getNodeRelationships()

getNodeRelationships(\Everyman\Neo4j\Node $node, mixed $types, string $dir) : mixed

Get all relationships on a node matching the criteria

Parameters

\Everyman\Neo4j\Node $node
mixed $types

a string or array of strings

string $dir

Returns

mixed —

false on error, else an array of Relationship objects

getPaths()

getPaths(\Everyman\Neo4j\PathFinder $finder) : array

Get an array of paths matching the finder's criteria

Parameters

\Everyman\Neo4j\PathFinder $finder

Returns

array

getReferenceNode()

getReferenceNode() : \Everyman\Neo4j\Node

Retrieve the reference node (id: 0) from the server

Returns

\Everyman\Neo4j\Node

getRelationship()

getRelationship(integer $id, boolean $force) : \Everyman\Neo4j\Relationship

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.

Parameters

integer $id
boolean $force

Returns

\Everyman\Neo4j\Relationship

getRelationshipTypes()

getRelationshipTypes() : array

Get a list of all relationship types on the server

Returns

array

getServerInfo()

getServerInfo(boolean $force) : array

Retrieve information about the server

Parameters

boolean $force

Don't use previous results

Returns

array

loadNode()

loadNode(\Everyman\Neo4j\Node $node) : boolean

Load the given node with data from the server

Parameters

\Everyman\Neo4j\Node $node

Returns

boolean

loadRelationship()

loadRelationship(\Everyman\Neo4j\Relationship $rel) : boolean

Load the given relationship with data from the server

Parameters

\Everyman\Neo4j\Relationship $rel

Returns

boolean

makeNode()

makeNode() : \Everyman\Neo4j\Node

Create a new node object bound to this client

Returns

\Everyman\Neo4j\Node

makeRelationship()

makeRelationship() : \Everyman\Neo4j\Relationship

Create a new relationship object bound to this client

Returns

\Everyman\Neo4j\Relationship

queryIndex()

queryIndex(\Everyman\Neo4j\Index $index, string $query) : array

Query an index using a query string.

The default query language in Neo4j is Lucene

Parameters

\Everyman\Neo4j\Index $index
string $query

Returns

array

removeFromIndex()

removeFromIndex(\Everyman\Neo4j\Index $index, \Everyman\Neo4j\PropertyContainer $entity, string $key, string $value) : boolean

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.

Parameters

\Everyman\Neo4j\Index $index
\Everyman\Neo4j\PropertyContainer $entity
string $key
string $value

Returns

boolean

saveIndex()

saveIndex(\Everyman\Neo4j\Index $index) : boolean

Save the given index

Parameters

\Everyman\Neo4j\Index $index

Returns

boolean

saveNode()

saveNode(\Everyman\Neo4j\Node $node) : boolean

Save the given node

Parameters

\Everyman\Neo4j\Node $node

Returns

boolean

saveRelationship()

saveRelationship(\Everyman\Neo4j\Relationship $rel) : boolean

Save the given relationship

Parameters

\Everyman\Neo4j\Relationship $rel

Returns

boolean

searchIndex()

searchIndex(\Everyman\Neo4j\Index $index, string $key, string $value) : array

Search an index for matching entities

Parameters

\Everyman\Neo4j\Index $index
string $key
string $value

Returns

array

setEntityMapper()

setEntityMapper(\Everyman\Neo4j\EntityMapper $mapper)

Set the entity mapper to use

Parameters

\Everyman\Neo4j\EntityMapper $mapper

setTransport()

setTransport(\Everyman\Neo4j\Transport $transport)

Set the transport to use

Parameters

\Everyman\Neo4j\Transport $transport

startBatch()

startBatch() : \Everyman\Neo4j\Batch

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.

Returns

\Everyman\Neo4j\Batch

runCommand()

runCommand(\Everyman\Neo4j\Command $command) : mixed

Run a command that will talk to the transport

Parameters

\Everyman\Neo4j\Command $command

Returns

mixed