PHP Class Neoxygen\NeoClient\Formatter\Result

显示文件 Open project: neoxygen/neo4j-neoclient Class Usage Examples

Protected Properties

Property Type Description
$errors
$identifiers array
$nodes Neoxygen\NeoClient\Formatter\Node[]
$relationships Neoxygen\NeoClient\Formatter\Relationship[]
$tableFormat array

Public Methods

Method Description
__construct ( )
addIdentifierValue ( $k, $v )
addNode ( Neoxygen\NeoClient\Formatter\Node $node )
addNodeToIdentifier ( $nodeId, $identifier )
addRelationship ( Neoxygen\NeoClient\Formatter\Relationship $relationship )
addRelationshipToIdentifier ( $relationshipId, $identifier )
addRowToIdentifier ( $value, $identifier )
get ( string $identifier, mixed $default = null, boolean $singleAsArray = false ) : mixed Returns the item or items bound to the given identifier, or $default if no items are bound.
getAllByIdentifier ( ) : array
getIdentifiers ( ) : string[]
getNodeById ( integer $id ) : Neoxygen\NeoClient\Formatter\Node | null Returns a single node by its Neo4j node ID number, or null if the node is not present in the result.
getNodes ( string | string[] | null $label = null, boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[] Returns all nodes if called without arguments. Returns all nodes with the given labels if called with an array of labels. Otherwise, acts identically as {@link Result::getNodesByLabels()}.
getNodesByLabel ( string $name, boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[] Returns all nodes with the given label.
getNodesByLabels ( array $labels = [], boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[] Returns all nodes with the given labels.
getNodesCount ( ) : integer
getRelationship ( integer $id ) : Neoxygen\NeoClient\Formatter\Relationship | null Returns the relationship by its Neo4j ID.
getRelationships ( ) : Neoxygen\NeoClient\Formatter\Relationship[]
getRelationshipsCount ( ) : integer
getSingle ( string $identifier, mixed $default = null ) : mixed Returns a single item bound to the given identifier, or the default if the identifier is not bound.
getSingleNode ( string | null $label = null ) : Neoxygen\NeoClient\Formatter\Node | null Returns a single node from the nodes collection Use when you do cypher queries returning only one node.
getSingleNodeByLabel ( string $label ) : Neoxygen\NeoClient\Formatter\Node | null Returns a single node for a given label.
getTableFormat ( ) : array
hasIdentifier ( string $i ) : boolean
setTableFormat ( array $table )

Method Details

__construct() public method

public __construct ( )

addIdentifierValue() public method

public addIdentifierValue ( $k, $v )

addNode() public method

public addNode ( Neoxygen\NeoClient\Formatter\Node $node )
$node Neoxygen\NeoClient\Formatter\Node

addNodeToIdentifier() public method

public addNodeToIdentifier ( $nodeId, $identifier )

addRelationship() public method

public addRelationship ( Neoxygen\NeoClient\Formatter\Relationship $relationship )
$relationship Neoxygen\NeoClient\Formatter\Relationship

addRelationshipToIdentifier() public method

public addRelationshipToIdentifier ( $relationshipId, $identifier )

addRowToIdentifier() public method

public addRowToIdentifier ( $value, $identifier )

get() public method

Returns the item or items bound to the given identifier, or $default if no items are bound.
public get ( string $identifier, mixed $default = null, boolean $singleAsArray = false ) : mixed
$identifier string
$default mixed A value to return if the identifier is not bound.
$singleAsArray boolean When true, always returns a single value as an array.
return mixed

getAllByIdentifier() public method

public getAllByIdentifier ( ) : array
return array

getIdentifiers() public method

public getIdentifiers ( ) : string[]
return string[]

getNodeById() public method

Returns a single node by its Neo4j node ID number, or null if the node is not present in the result.
public getNodeById ( integer $id ) : Neoxygen\NeoClient\Formatter\Node | null
$id integer Neo4j node ID.
return Neoxygen\NeoClient\Formatter\Node | null

getNodes() public method

Returns all nodes if called without arguments. Returns all nodes with the given labels if called with an array of labels. Otherwise, acts identically as {@link Result::getNodesByLabels()}.
public getNodes ( string | string[] | null $label = null, boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[]
$label string | string[] | null
$labelizedKeys boolean
return Neoxygen\NeoClient\Formatter\Node[]

getNodesByLabel() public method

Returns all nodes with the given label.
public getNodesByLabel ( string $name, boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[]
$name string
$labelizedKeys boolean When true, the results are indexed by node label. Assumes only one node per label.
return Neoxygen\NeoClient\Formatter\Node[]

getNodesByLabels() public method

Returns all nodes with the given labels.
public getNodesByLabels ( array $labels = [], boolean $labelizedKeys = false ) : Neoxygen\NeoClient\Formatter\Node[]
$labels array
$labelizedKeys boolean When true, the results are indexed by node label. Assumes one node per label.
return Neoxygen\NeoClient\Formatter\Node[]

getNodesCount() public method

public getNodesCount ( ) : integer
return integer Number of nodes in the result.

getRelationship() public method

Returns the relationship by its Neo4j ID.
public getRelationship ( integer $id ) : Neoxygen\NeoClient\Formatter\Relationship | null
$id integer The id of the relationship.
return Neoxygen\NeoClient\Formatter\Relationship | null

getRelationships() public method

public getRelationships ( ) : Neoxygen\NeoClient\Formatter\Relationship[]
return Neoxygen\NeoClient\Formatter\Relationship[]

getRelationshipsCount() public method

public getRelationshipsCount ( ) : integer
return integer Number of relationships in the result.

getSingle() public method

Returns a single item bound to the given identifier, or the default if the identifier is not bound.
public getSingle ( string $identifier, mixed $default = null ) : mixed
$identifier string
$default mixed A value to return if the identifier is not bound.
return mixed

getSingleNode() public method

Returns a single node from the nodes collection Use when you do cypher queries returning only one node.
public getSingleNode ( string | null $label = null ) : Neoxygen\NeoClient\Formatter\Node | null
$label string | null Return a node for this label only.
return Neoxygen\NeoClient\Formatter\Node | null

getSingleNodeByLabel() public method

Returns a single node for a given label.
public getSingleNodeByLabel ( string $label ) : Neoxygen\NeoClient\Formatter\Node | null
$label string The label to match for
return Neoxygen\NeoClient\Formatter\Node | null The Node or null if not node found matching the label

getTableFormat() public method

public getTableFormat ( ) : array
return array

hasIdentifier() public method

public hasIdentifier ( string $i ) : boolean
$i string Query identifier to check.
return boolean

setTableFormat() public method

public setTableFormat ( array $table )
$table array

Property Details

$errors protected_oe property

protected $errors

$identifiers protected_oe property

protected array $identifiers
return array

$nodes protected_oe property

protected Node[],Neoxygen\NeoClient\Formatter $nodes
return Neoxygen\NeoClient\Formatter\Node[]

$relationships protected_oe property

protected Relationship[],Neoxygen\NeoClient\Formatter $relationships
return Neoxygen\NeoClient\Formatter\Relationship[]

$tableFormat protected_oe property

protected array $tableFormat
return array