Node Class

class Node

Represents a Node in a Flowchart diagram

__construct(NodeShape $shape = NodeShape::process, ?string $id = null)

Creates a Node

Parameters:
Returns:

A new instance of Node

Return type:

Node

withComment(string $comment)

Add a comment

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Node with the comment

Return type:

Node

withInteraction(string $interaction, InteractionType $type, ?string $tooltip = null, InteractionTarget $target = InteractionTarget::Self)

Add an interaction to the node

Parameters:
  • $interaction (string) – The interaction, either a callback or URL

  • $type (InteractionType) – The interaction type

  • $tooltip (?string) – A tooltip for the interaction

  • $target (InteractionTarget) – The interaction target if $type === Interaction::Link (default: InteractionTarget::Self)

Returns:

A new instance of Node with the interaction

Return type:

Node

withStyleClass(string $styleClass)

Set a style class for the node

Parameters:
  • $styleClass (string) – The style class

Returns:

A new instance of Node with the style class

Return type:

Node

withText(string $text)

Add text to the node

Parameters:
  • $text (string) – The text

Returns:

A new instance of Node with the text

Return type:

Node