alexandresalome/doctrine-extra-bundle

Doctrine的额外功能,作为Symfony包

v0.3.4 2020-04-28 12:46 UTC

This package is auto-updated.

Last update: 2024-08-28 21:38:50 UTC


README

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

Doctrine的图形工具。依赖于Graphviz

Demo

安装

使用以下命令安装最新版本

composer require --dev alexandresalome/doctrine-extra-bundle

然后,通过在您的项目中的app/AppKernel.php文件中添加以下行来启用该包

// 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();
        }


        // ...
    }

    // ...
}

用法

将实体管理器模式作为图形导出

php app/console doctrine:mapping:graphviz

如果您想使用Linux创建PDF文件

.. code-block:: bash

php app/console doctrine:mapping:graphviz | dot -Tpdf -oout.pdf
xdg-open out.pdf

开发

生成示例图形

有一组示例实体可用于测试内部模式生成。您可以通过运行以下命令为任何示例(位于Tests/Fixtures)生成图形

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