Skip to content

arnaudgoulpeau/doctrine-schema-exporter

 
 

Repository files navigation

DoctrineExtraBundle

Build status Latest Stable Version Total Downloads License Monthly Downloads Daily Downloads

Graph tool for Doctrine. Relies on Graphviz.

Demo

Installation

Install the latest version with

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:

// 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

or

php app/console doctrine:mapping:graphviz --use-random-edge-color --business-split-file=business-restriction-example.yml --font=Arial

If you want to create a PDF file out of it, with Linux:

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:

./Resources/bin/graph Simple | dot -Tpdf -oout.pdf
xdg-open out.pdf

Tests

Use phpunit 5

About

Graph features for Doctrine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%