Graphviz
extends AbstractVisitor
in package
Create a Graphviz output of a Schema.
Tags
Table of Contents
Properties
- $output : string
Methods
- acceptColumn() : void
- acceptForeignKey() : void
- acceptIndex() : void
- acceptNamespace() : void
- Accepts a schema namespace name.
- acceptSchema() : void
- acceptSequence() : void
- acceptTable() : void
- getOutput() : string
- Get Graphviz Output
- write() : void
- Writes dot language output to a file. This should usually be a *.dot file.
- createNode() : string
- createNodeRelation() : string
- createTableLabel() : string
Properties
$output
private
string
$output
= ''
Methods
acceptColumn()
public
acceptColumn(Table $table, Column $column) : void
Parameters
acceptForeignKey()
public
acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) : void
Parameters
- $localTable : Table
- $fkConstraint : ForeignKeyConstraint
acceptIndex()
public
acceptIndex(Table $table, Index $index) : void
Parameters
acceptNamespace()
Accepts a schema namespace name.
public
acceptNamespace(mixed $namespaceName) : void
Parameters
- $namespaceName : mixed
-
The schema namespace name to accept.
acceptSchema()
public
acceptSchema(Schema $schema) : void
Parameters
- $schema : Schema
acceptSequence()
public
acceptSequence(Sequence $sequence) : void
Parameters
- $sequence : Sequence
acceptTable()
public
acceptTable(Table $table) : void
Parameters
- $table : Table
getOutput()
Get Graphviz Output
public
getOutput() : string
Return values
stringwrite()
Writes dot language output to a file. This should usually be a *.dot file.
public
write(string $filename) : void
You have to convert the output into a viewable format. For example use "neato" on linux systems and execute:
neato -Tpng -o er.png er.dot
Parameters
- $filename : string
createNode()
private
createNode(string $name, array<string|int, string> $options) : string
Parameters
- $name : string
- $options : array<string|int, string>
Return values
stringcreateNodeRelation()
private
createNodeRelation(string $node1, string $node2, array<string|int, string> $options) : string
Parameters
- $node1 : string
- $node2 : string
- $options : array<string|int, string>
Return values
stringcreateTableLabel()
private
createTableLabel(Table $table) : string
Parameters
- $table : Table