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

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.

  • Merge pull request #18 from gisostallenberg/fix-travis
    By web-flow, 4 months ago
  • Run tests only in supported PHP versions
    By gisostallenberg, 4 months ago
  • Use newer php versions in Travis and run on lowest vendor code
    By gisostallenberg, 4 months ago
  • Merge pull request #17 from gisostallenberg/inject-doctrine
    By web-flow, 4 months ago
  • Fix tests
    By gisostallenberg, 4 months ago
  • Run the command without being ContainerAware
    By gisostallenberg, 4 months ago
  • Merge pull request #16 from nud/no-reverse
    By web-flow, 4 months ago
  • Merge pull request #15 from nud/register-commands
    By web-flow, 4 months ago
  • Make it possible to not include reverse edges
    By nud, 2 years ago
  • Explicitely register CLI commands
    By nud, 2 years ago
  • add a release date to 0.3.0
    By alexandresalome, 4 years ago
  • cleanup
    By alexandresalome, 4 years ago
  • use new version of graphviz component
    By alexandresalome, 4 years ago
  • Fix alignment of properties and associations
    By alexandresalome, 4 years ago
  • complete simple tests
    By alexandresalome, 4 years ago
  • add some tests
    By alexandresalome, 4 years ago
  • better documentation
    By alexandresalome, 4 years ago
  • Merge pull request #13 from Gregoire-M/master
    By web-flow, 4 years ago
  • Changed entity display ("\n" in fields list does't work anymore)
    By gmarchal, 4 years ago
  • Merge pull request #12 from theofidry/patch-1
    By OskarStark, 4 years ago
  • Install as dev bundle
    By theofidry, 4 years ago
  • Merge pull request #3 from rjmunro/feature/fixes
    By Alexandre Salomé, 4 years ago
  • Merge pull request #8 from OskarStark/patch-2
    By Alexandre Salomé, 4 years ago
  • added step to enable the bundle
    By OskarStark, 5 years ago
  • Merge pull request #6 from OskarStark/patch-1
    By Alexandre Salomé, 5 years ago
  • Use PHP_EOL instead of "\n"
    By rjmunro, 5 years ago
  • Make clustering work for \ as well as : separators
    By rjmunro, 5 years ago
  • Don’t encode newlines as \l - it happens downstream
    By rjmunro, 5 years ago
  • added installation instruction
    By OskarStark, 5 years ago
  • Merge pull request #1 from pborreli/patch-1
    By Alexandre Salomé, 5 years ago