Developed with love by KnpLabs Hire us for your project!
0

doctrine-extra-bundle

by alexandresalome

Graph features for Doctrine

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

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

.. code-block:: bash

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
The MIT License (MIT)

Copyright (c) 2013 Alexandre Salomé

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.