PHP Interface Gliph\Graph\MutableVertexSet

This is an atomic component interface for graphs.
Show file Open project: sdboyer/gliph

Public Methods

Method Description
ensureVertex ( object $vertex ) : Gliph\Graph\Graph Ensures a vertex is present in the graph.
removeVertex ( object $vertex ) : Gliph\Graph\Graph Remove a vertex from the graph.

Method Details

ensureVertex() public method

Gliph requires that its graph vertices be objects; beyond that, it does not care about vertex type.
public ensureVertex ( object $vertex ) : Gliph\Graph\Graph
$vertex object An object to use as a vertex in the graph.
return Gliph\Graph\Graph The current graph instance.

removeVertex() public method

This will also remove any edges that include the vertex.
public removeVertex ( object $vertex ) : Gliph\Graph\Graph
$vertex object A vertex object to remove from the graph.
return Gliph\Graph\Graph The current graph instance.