devhelp/mixed-mapping-driver-demo-bundle

dev-master 2013-06-18 18:32 UTC

This package is not auto-updated.

Last update: 2024-09-23 14:18:24 UTC


README

由 Devhelp.pl (http://devhelp.pl) 提供的捆绑包

目的

这是一个简单的演示,说明 doctrine 在 symfony 中如何处理当实体同时使用注解、yaml 和 xml 进行映射的情况。

剧透警报!

它不能处理这种情况 ;) 您只能使用其中一个驱动程序来映射相同的实体,而不是混合多个驱动程序

剧透警报! - 结束

基本上,这是映射驱动程序的顺序。如果前面的驱动程序不存在,则应用下一个驱动程序。

  • XML
  • YAML
  • 注解

安装

Composer

将包添加到 composer.json

"require" : {
    "devhelp/mixed-mapping-driver-demo-bundle": "dev-master"
}

运行更新

composer update

在您的内核类中注册捆绑包

public function registerBundles()
{
    $bundles = array(
        //...
        new Devhelp\Bundle\MixedMappingDriverDemoBundle\DevhelpMixedMappingDriverDemoBundle(),
        //...
    );
}

使用

运行模式更新任务以查看它

php app/console doctrine:schema:update --dump-sql