libSmalldb  v2.0.2
Public Member Functions | Protected Member Functions | List of all members
Node Class Reference

Inheritance diagram for Node

Public Member Functions

 __construct (NestedGraph $graph, string $id, array $attrs)
 
 remove ()
 
 connectEdge (Edge $edge)
 
 disconnectEdge (Edge $edge)
 
 getConnectedEdges ()
 Get list of edges connected to this node. More...
 
 getNestedGraph ()
 Get nested graph of this node. More...
 
 hasNestedGraph ()
 Does the node have a nested graph? More...
 
 getId ()
 
 getGraph ()
 
 getRootGraph ()
 
 offsetSet ($key, $value)
 
offsetGet ($key)
 
 getAttr (string $key, $defaultValue=null)
 
 offsetUnset ($key)
 
 setAttr (string $key, $newValue)
 
 removeAttr (string $key)
 
 offsetExists ($key)
 
 getAttributes ()
 

Protected Member Functions

 onAttrChanged (string $key, $oldValue, $newValue)
 Handle change of an attribute. More...
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( NestedGraph  $graph,
string  $id,
array  $attrs 
)

Member Function Documentation

◆ remove()

remove ( )

◆ connectEdge()

connectEdge ( Edge  $edge)

◆ disconnectEdge()

disconnectEdge ( Edge  $edge)

◆ getConnectedEdges()

getConnectedEdges ( )

Get list of edges connected to this node.

An edge may be connected multiple times to the node, but it will be present in this list only once.

Returns
Edge[]

◆ getNestedGraph()

getNestedGraph ( )

Get nested graph of this node.

The graph is created if the node does not have any.

Returns
NestedGraph

◆ hasNestedGraph()

hasNestedGraph ( )

Does the node have a nested graph?

◆ onAttrChanged()

onAttrChanged ( string  $key,
  $oldValue,
  $newValue 
)
protected

Handle change of an attribute.

◆ getId()

getId ( )
inherited

◆ getGraph()

getGraph ( )
inherited

◆ getRootGraph()

getRootGraph ( )
inherited

◆ offsetSet()

offsetSet (   $key,
  $value 
)
inherited

◆ offsetGet()

& offsetGet (   $key)
inherited

◆ getAttr()

getAttr ( string  $key,
  $defaultValue = null 
)
inherited

◆ offsetUnset()

offsetUnset (   $key)
inherited

◆ setAttr()

setAttr ( string  $key,
  $newValue 
)
inherited
Returns
$this

◆ removeAttr()

removeAttr ( string  $key)
inherited
Returns
$this

◆ offsetExists()

offsetExists (   $key)
inherited

◆ getAttributes()

getAttributes ( )
inherited