libSmalldb  v0.7-66-gb94d22a
Public Member Functions | List of all members
Graph Class Reference

Inheritance diagram for Graph

Public Member Functions

 createNestedGraph (Node $parentNode)
 
 getNodeById (string $id)
 
 getEdgeById (string $id)
 
 getAllNodes ()
 Get all nodes in the graph, including nodes in nested graphs. More...
 
 getAllEdges ()
 Get all edges in the graph, including edges in nested graphs. More...
 
 getNodesByAttr (string $key, $value=true)
 Get nodes which have attribute $key equal to $value. More...
 
 getEdgesByAttr (string $key, $value=true)
 Get edges which have attribute $key equal to $value. More...
 
 indexNodeAttr ($key)
 
 indexEdgeAttr ($key)
 
- Public Member Functions inherited from NestedGraph
 getRootGraph ()
 
 getNodes ()
 Get all nodes in the graph. More...
 
 getEdges ()
 Get all edges in the graph. More...
 
 createNode (string $id, array $attrs)
 Create node and add it to the graph. More...
 
 addNode (Node $node)
 Add existing node to the graph. More...
 
 getNode (string $id)
 Get node by its ID. More...
 
 removeNode (Node $node)
 Remove node and connected edges from the graph. More...
 
 createEdge (string $id=null, Node $start, Node $end, array $attrs)
 Create a new edge and add it to the graph. More...
 
 addEdge (Edge $edge)
 Add existing edge to the graph. More...
 
 getEdge (string $id)
 Get Edge by its ID. More...
 
 removeEdge (Edge $edge)
 Remove edge from the graph and disconnect it from nodes. More...
 
 getParentNode ()
 
 nodeAttrChanged ($node, $key, $oldValue, $newValue)
 
 edgeAttrChanged ($node, $key, $oldValue, $newValue)
 

Additional Inherited Members

- Protected Member Functions inherited from NestedGraph
 __construct (Node $parentNode=null)
 Constructor. More...
 
- Protected Attributes inherited from NestedGraph
 $rootGraph
 Root graph. More...
 
 $nodeAttrIndex
 Node index. More...
 
 $edgeAttrIndex
 Edge index. More...
 

Member Function Documentation

◆ getNodeById()

getNodeById ( string  $id)

PhpIncompatibleReturnTypeInspection

◆ getEdgeById()

getEdgeById ( string  $id)

PhpIncompatibleReturnTypeInspection

◆ getAllNodes()

getAllNodes ( )

Get all nodes in the graph, including nodes in nested graphs.

Returns
Node[]

◆ getAllEdges()

getAllEdges ( )

Get all edges in the graph, including edges in nested graphs.

Returns
Edge[]

◆ getNodesByAttr()

getNodesByAttr ( string  $key,
  $value = true 
)

Get nodes which have attribute $key equal to $value.

Parameters
string$key
mixed$value
Returns
Node[]

◆ getEdgesByAttr()

getEdgesByAttr ( string  $key,
  $value = true 
)

Get edges which have attribute $key equal to $value.

Parameters
string$key
mixed$value
Returns
Node[]