Class representing a node / element in a graph.

category phpDocumentor
package GraphViz
author Mike van Riel
copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
license MIT
link http://phpdoc.org

 Methods

Magic method to provide a getter/setter to add attributes on the Node.

__call(string $name, \mixed[] $arguments) : \phpDocumentor_GraphViz_Attribute[] | \phpDocumentor_GraphViz_Node | null

Using this method we make sure that we support any attribute without too much hassle. If the name for this method does not start with get or set we return null.

Set methods return this graph (fluent interface) whilst get methods return the attribute value.

Parameters

$name

string

Method name; either getX or setX is expected.

$arguments

\mixed[]

List of arguments; only 1 is expected for setX.

Returns

Creates a new node with name and optional label.

__construct(string $name, string | null $label) 

Parameters

$name

string

Name of the new node.

$label

stringnull

Optional label text.

Returns the node definition as is requested by GraphViz.

__toString() : string

Returns

string

Factory method used to assist with fluent interface handling.

create(string $name, string | null $label) : \phpDocumentor_GraphViz_Node

See the examples for more details.

Parameters

$name

string

Name of the new node.

$label

stringnull

Optional label text.

Returns

Returns the name for this node.

getName() : string

Returns

string

Sets the name for this node.

setName(string $name) : \phpDocumentor_GraphViz_Node

Not to confuse with the label.

Parameters

$name

string

Name for this node.

Returns

 Properties

 

List of attributes for this node

$attributes : \phpDocumentor_GraphViz_Attribute[]

 

Name for this node

$name : string