, (*1)
Graph tool for Doctrine. Relies on Graphviz., (*2)
, (*3)
Installation
Install the latest version with, (*4)
composer require --dev alexandresalome/doctrine-extra-bundle
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:, (*5)
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
//...
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
// ...
// Because the vendor code could be not present, you should check if the bundle is here before using it.
$bundles[] = new Alex\DoctrineExtraBundle\AlexDoctrineExtraBundle();
}
// ...
}
// ...
}
Usage
Dump entity manager schema as graph
php app/console doctrine:mapping:graphviz
If you want to create a PDF file out of it, with Linux:, (*6)
.. code-block:: bash, (*7)
php app/console doctrine:mapping:graphviz | dot -Tpdf -oout.pdf
xdg-open out.pdf
Development
Generate sample graphs
A set of sample entities are available to test internally the schema generations. You can generate the graph for any of the samples (located in Tests/Fixtures) by running:, (*8)
./Resources/bin/graph Simple | dot -Tpdf -oout.pdf
xdg-open out.pdf