chaplean/doctrine-extensions-bundle

Doctrine 扩展(包括 Gedmo)

v5.0.1 2019-07-08 14:24 UTC

This package is auto-updated.

Last update: 2024-09-09 02:57:14 UTC


README

先决条件

本版本的包需要 Symfony 2.8+。

安装

1. Composer

composer require chaplean/doctrine-extensions-bundle

2. AppKernel.php

添加

            new Chaplean\Bundle\DoctrineExtensionsBundle\ChapleanDoctrineExtensionsBundle(),
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),

3. app/config/config.yml

可选:为 loggable/translatable/tree 添加映射

添加行

doctrine:
    orm:
        mappings:
            translatable:
                type: annotation
                alias: Gedmo
                prefix: Gedmo\Translatable\Entity
                # make sure vendor library location is correct
                dir: '%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity'
            loggable:
                type: annotation
                alias: Gedmo
                prefix: Gedmo\Loggable\Entity
                dir: '%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity'
            tree:
                type: annotation
                alias: Gedmo
                prefix: Gedmo\Tree\Entity
                dir: '%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity'