swissengine/doctrine-module-extension

Doctrine CLI 工具的扩展

dev-master 2015-02-13 09:01 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:02:54 UTC


README

这个小型模块旨在提供一种简单的方式(无缝集成)将一些功能添加到 doctrine CLI 工具(ZF2)中,例如可选地指定我们想要使用的实体管理器。

php public/index.php orm:validate-schema --em=orm_custom

安装

建议的安装方法是使用 composer

php composer.phar require swissengine/doctrine-module-extension:dev-master

设置

如果您使用 Zend Framework 2,您现在可以通过将其添加到 config/application.config.php 作为 SwissEngine\Tools\Doctrine\Extension 来在您的应用程序中启用此模块。

请确保,为了使此功能正常工作,您已在您的配置文件中设置了 doctrine 工厂。

[
    'service_manager' => [
        'factories' => [
            'doctrine.entitymanager.orm_custom' => new \DoctrineORMModule\Service\EntityManagerFactory('orm_custom'),
        ],
    ]
];