ORM convert-mapping正在创建错误的文件结构

时间:2015-11-16 16:02:58

标签: symfony orm silex directory-structure

我目前在我的silex应用程序上设置了orm。除了运行命令从我的数据库生成实体(逆向工程)时,一切似乎都按预期工作。

../../../vendor/bin/doctrine orm:convert-mapping --namespace="Random\MyApp\Model\Random\Entities" --force --from-database annotation ./../random/entities

此命令将完美地创建我的所有实体,但它们将位于文件夹结构

./../random/entities/Random/MyApp/Model/Random/Entities/(files here)

这是错误的,因为我期待

./../random/entities/(files here)

1 个答案:

答案 0 :(得分:0)

命名空间实际上是您的实体下的路径分组。因此,doctrine在此命名空间下生成文件是完全合乎逻辑的。

如果你想要一个像它一样的文件结构:

../../../vendor/bin/doctrine orm:convert-mapping --namespace="random/entities" --force --from-database annotation ./

但这绝对不符合PSR-0

相关问题